Wednesday, February 10, 2016

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


Tobias,

I know I will not help you directly, but maybe my setup + process can help someone else. I am deploying towards Redhat Openshift 2 PaaS.
I was in the similar situation choosing the best fit option for continuous deployment.

Final process:

- Merging the feature code to the master branch and pushing to github.
- Codeship autograbs the code from github, does CI tests.
- If tests pass it pushes to Openshift with hot_deploy setup (i.e. the old version is still running during the deploy phase). 
- Once the new version is on Openshift incl. all updated requirements it restarts the WSGI process (= very short downtime) and the new version is up.
- TODO some automated smoke tests towards Openshift production

The whole thing lasts a few minutes totally on the background, I am only notified of the success / failure.

And I can make some hot fixes through github's web interface :)

note: fabric is not compatible with Python 3, so its nogo for me. 

Radek

On Wednesday, February 10, 2016 at 9:50:22 AM UTC+1, Tobias Dacoir wrote:
We've build a small web application using Django 1.8 over the past couple of months and we are going live with version 1.0 soon (one last closed beta test is coming up).
So far we have deployed it on an Ubuntu VM (in Azure) using Apache / Nginx and a local MySQL Server.

I've already found some good tutorials on how to properly set it up (http://rogueleaderr.com/post/65157477648/the-idiomatic-guide-to-deploying-django-in#disqus_thread ) however what I am mising now is how to handle updates to our code.

For our development server we have a git hook that automatically deploys new commits to the server. However that often requires manual interaction - running manage.py makemigrations etc. Sometimes Django also does not pick up our changed models and we have to manually fiddle with the Database in order to get it back running. We even had times where we lost all our data since it was easier to just start with a new database.

Obviously this can't happen once we are live and obviously we want downtime to be as small as possible. So is there any guide on how to update code of a live, deployed Django application?

--
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/c8fcfab2-6427-430c-8c9b-2ba1d05d3fa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment