WebFaction
Community site: login faq
0
2

How can I get a seamless (minimal or no site downtime) update of code in my Django project? When I pull new code any templates will be seen right away, but the actual python code is cached in the web server. Restarting the Apache process with 'apache2/bin/restart' works fine, but visitors get a 500 Server Error for a few seconds.

How can I get seamless or quick code updates, under WSGI/Apache on Webfaction, with Django?

asked 01 Nov '13, 18:09

brycenesbitt
91719
accept rate: 0%


Several approaches to this are available in the mod_wsgi wiki: ReloadingSourceCode

Hope that helps!

permanent link

answered 01 Nov '13, 18:21

seanf
12.2k21736
accept rate: 37%

edited 01 Nov '13, 18:21

Yeah, I read that, and found myself asking "is it really that hard"? I don't know the answer even to the first question: am I running in daemon mode? My hope is there are better webfaction specific instructions that would not kill an entire tree if planted.

(01 Nov '13, 23:58) brycenesbitt

Yes, you're running in daemon mode. Usually this is just a matter of touching your WSGI file:

touch $HOME/webapps/django/myapp/myapp/myapp.wsgi

More information is available here.

(02 Nov '13, 00:10) ryans ♦♦

@ryans I don't seem to have a wsgi file in this particular project, nor a 'mysite.settings' file.

Do you mean: $HOME/webapps/xxxxxx/myproject/yyyyyyy/wsgi.py

(05 Nov '13, 12:42) brycenesbitt

Yes, sorry - $HOME/webapps/xxxxxx/myproject/yyyyyyy/wsgi.py is the file (or whatever you have specified as your WSGIScriptAlias in your httpd.conf.

(05 Nov '13, 12:47) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×901
×222
×112
×62
×24

question asked: 01 Nov '13, 18:09

question was seen: 8,768 times

last updated: 05 Nov '13, 12:47

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM