Upgrading Wagtail to use Django 1.7 locally using vagrant

These are the steps I followed to upgrade an existing Wagtail 0.8.3 which was using Django 1.6 to use 1.7. It wasn’t that obvious to me so I’ve detailed the steps here.

This assumes you’re using Vagrant locally, to test things, I cloned a new local version of our site in case it went wrong, which it did a few times before I got it right.

The steps may differ depending on how you set things up, and if you’re using additional/different Python modules etc

Firslty make these changes in the wagtail project :

Edit base.txt in requirements, and remove south, set django to 1.7, set taggit to use 0.12.0

Edit base.py in settings (and any other settings files) and remove south from installed apps.

Delete all the old south numbered migrations but leave the migration folder and the __init__.py file (Migrations are now handled with Django,and will be remade from scratch, so you don’t need the old south ones)

Also it’s worth checking through the Wagtail release notes to make sure you’ve checked the upgrade considerations related to Django 1.7, they can be found here : http://docs.wagtail.io/en/latest/releases/index.html

then to get it running locally using vagrant:

Go to your vagrant folder for the project,  do vagrant destroy if you’re not working from scratch.

Ignore this warning when it appears at various points :
RemovedInDjango18Warning: `MP_NodeManager.get_query_set` method should be renamed `get_queryset`.
class MP_NodeManager(models.Manager):

vagrant up
vagrant ssh
cd /vagrant

(next 3 steps assume you have existing data for your local vagrant in a sql file, skip otherwise)

dropdb -Upostgres <dbname>

createdb -Upostgres <dbname>

psql -Upostgres foxtail -f<dbname>.sql

./manage.py makemigrations
./manage.py migrate –fake

That’s it, these steps worked for me, hopefully they’ll be some help.

For more info on Django 1.7 and migrations – https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-from-south

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.