[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed to test packages with Django 1.7



On 7 August 2014 10:19, Brian May <brian@microcomaustralia.com.au> wrote:
virtualenv --system-site-packages ~/old_django
. ~/old_django/bin/activate
pip install django==1.6.5
pip install django-south
django-admin --settings=??? migrate --all

Calling django-admin like that won't use the virtualenv.
 
touch /etc/xyz/south_migrations_complete
deactivate
rm -rf ~/old_django

Latest version of this:

=== cut ===
#!/bin/sh

set -ex

TMPDIR=$(mktemp -d)
trap "rm -rf -- '$TMPDIR'" EXIT HUP INT TERM

virtualenv --system-site-packages "$TMPDIR"
. "$TMPDIR/bin/activate"

pip install django==1.6.5
pip install south

python /usr/bin/django-admin -smyapp.settings migrate "$@"
=== cut ===

Note that I have explicitly called python. This ensures Python 3 not used (not supported by South + the virtualenv is Python 2 only) and that we get the python from the virtualenv.

I have tested this and it appears to work, although the above was changed not to be specific to my app.
-- 
Brian May <brian@microcomaustralia.com.au>

Reply to: