Differences between Devserver and Apache
Running with ./manage.py devserver is very handy, but it may allow you to create things that won't 'just work' when you move the site to Apache. (or other servers.)
As I run into troubles porting my site, I hear things like "maybe it is because X." I call this a rumor. I also hear "Yes, X happens because Y." If Y supports X, I call it a confirmed rumor. So onto the rumors.
Rumors
- Default Apache config does not follow SymLinks?, Devserver does. (There are FollowSymLinks? and other options if you need them. http://httpd.apache.org/docs/2.0/mod/core.html#options )
- Devserver adds installed apps to sys.path, Apache does not.
- to setup same path as devserver, you need both the directory the settings.py file is in and the parent of that directory.
- devserver serves up static files. apache does too, but you need to tell it to.
- devserver re-validates model changes automatically. Under apache, the django process has to be restarted to pick up model changes.
Facts
- "Note that the Django development server automagically serves admin media files, but this is not the case when you use any other server arrangement." http://www.djangoproject.com/documentation/modpython/#serving-media-files
- devserver's current may not be the same as apache's. so if your view code references files with relitive paths you will have trouble.
- some request.META keys are different, e.g. on the devserver the Content-Type is in request.META['CONTENT_TYPE'] while on mod_python that key exists but the value is always None and the actual value is in request.META['HTTP_CONTENT_TYPE']
