Wednesday, February 10, 2016

Re: How to update a live / deployed Django project?

Hi,

What I tend to do when deploying is:
1. Create a fabric script that contains a reference to the server that should be updated (defaults to dev server).
2. Use git archive to zip the contents of a git tag to a local file.
3. Upload the file to the server
4. Stop the uwsgi process
5. Update files
6. Run migrate, collectstatic
7. Start uwsgi process
8. Delete archive file from server.
9. Done!

I really don't see when a migration would need manual updates? If that is happening, you are probably doing migrations wrong - as someone pointed out earlier. We are running several production workloads with this configuration and have never needed to manually apply any migrations - except when migrating the database from postgres to mysql. 

I like the deployment process to be as automated as possible, and usually not need any manual "help" to get it working (even to the point of being deployed from a CI server automatically). 

Regards,

Andréas

2016-02-10 14:04 GMT+01:00 Tobias Dacoir <falc410@gmail.com>:
Thanks for the reply.

Thanks for the advice. We should include the migrate command into our git hook as well. But like I said, sometimes it's not always possible as manual interaction is required. At least for 1.0 our model should not change much, except for future extensions and new models.

We also have a development / test server that is a direct clone of the future live server. However I still don't have the workflow laid out. Should we use KISS and just upload a zip of our new version and just replace the whole folder on the live server with the new code and issue an Apache restart afterwards (not even sure that this is needed in order to pick up the new code)?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a8ae9869-83cb-4023-a884-91ebf8190724%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALXYUbmDgRF1hPKPt_kFn%3DWehMVj9vCCZzTy6W2Jzdb8RK0%3DLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment