Django

Code

Changeset 221

Show
Ignore:
Timestamp:
07/19/05 15:05:52 (3 years ago)
Author:
adrian
Message:

Added some more to docs/modpython.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/modpython.txt

    r220 r221  
    66production server. 
    77 
    8 mod_python, available at http://www.modpython.org/ , is similar to mod_perl: It 
    9 embeds Python within Apache and loads Python code into memory when the server 
    10 starts. Code stays in memory throughout the life of an Apache process, which 
    11 leads to significant performance gains over other server arrangements. 
     8mod_python, available at http://www.modpython.org/ , is similar to 
     9`mod_perl`_ : It embeds Python within Apache and loads Python code into memory 
     10when the server starts. Code stays in memory throughout the life of an Apache 
     11process, which leads to significant performance gains over other server 
     12arrangements. 
    1213 
    1314To configure Django with mod_python, first make sure you have Apache installed, 
     
    2627in dotted-package syntax. 
    2728 
     29This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the 
     30Django mod_python handler." It passes the value of ``DJANGO_SETTINGS_MODULE`` 
     31so mod_python knows which settings to use. 
     32 
     33Also, if you've manually altered your ``PYTHONPATH`` to put your Django project 
     34on it, you'll need to tell mod_python:: 
     35 
     36    PythonPath "['/path/to/project'] + sys.path" 
     37 
     38You can also add directives such as ``PythonAutoReload Off`` for performance. 
     39See the `mod_python documentation`_ for a full list of options. 
     40 
    2841Restart Apache, and any request to /mysite/ or below will be served by Django. 
    2942Note that Django's URLconfs won't trim the "/mysite/" -- they get passed the 
    3043full URL. 
     44 
     45When deploying Django sites on mod_python, you'll need to restart Apache each 
     46time you make changes to your Python code. 
    3147 
    3248Here's a template for an admin configuration:: 
     
    4056 
    4157The only thing different here is the ``DJANGO_SETTINGS_MODULE``. 
     58 
     59.. _mod_perl: http://perl.apache.org/ 
     60.. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html