Changes between Version 8 and Version 9 of devserver_and_apache_differences


Ignore:
Timestamp:
06/29/2008 11:57:10 AM (7 years ago)
Author:
Carl Karsten <carl@…>
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • devserver_and_apache_differences

    v8 v9  
    1 Differences between Devserver and Apache
     1Differences between devserver and Apache
    22
    3 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.)
     3Running with ./manage.py devserver is very handy, but things may not 'just work' when you move the site to Apache. (or other servers.)
    44
    5 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.
     5 * "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
    66
    7 == Rumors ==
     7 * devserver's current dir may not be the same as apache's.  so if your view code references files with relitive paths you will have trouble.
     8
     9 * 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']}}}
    810
    911 * 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 )
    1012
    11  * Devserver adds installed apps to sys.path, Apache does not.
    12 
    13  * to setup same path as devserver, you need both the directory the settings.py file is in and the parent of that directory.
    14 
    15  * devserver serves up static files.  apache does too, but you need to tell it to.
    16 
    17  * devserver re-validates model changes automatically. Under apache, the django process has to be restarted to pick up model changes.
    18 
    19 == Facts ==
    20 
    21  * "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
    22 
    23  * 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.
    24 
    25  * 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']}}}
    26 
     13 * devserver re-validates model changes automatically. Under apache, the django process has to be restarted to pick up model changes. "The development server automatically reloads Python code for each request."  http://www.djangoproject.com/documentation/django-admin/#runserver-optional-port-number-or-ipaddr-port
     14 
     15 * Devserver adds installed apps to sys.path, Apache does not.  (best support I could find: "...manage.py, because it takes care of setting the Python path for you." http://www.djangoproject.com/documentation/django-admin/#pythonpath
Back to Top