Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated install.txt and modpython.txt to note required Apache and mod…

…_python versions. Also gave full example for Apache config

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1123 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 54c3367a6301f7f7978727aee92edbdc98b80dee 1 parent c6ef1e0
Adrian Holovaty authored November 07, 2005
2  docs/install.txt
@@ -15,7 +15,7 @@ mod_python is similar to mod_perl -- it embeds Python within Apache and loads
15 15
 Python code into memory when the server starts. Code stays in memory throughout
16 16
 the life of an Apache process, which leads to significant performance gains
17 17
 over other server arrangements. Make sure you have Apache installed, with the
18  
-mod_python module activated.
  18
+mod_python module activated. Django requires Apache 2.x and mod_python 3.x.
19 19
 
20 20
 See `How to use Django with mod_python`_ for information on how to configure
21 21
 mod_python once you have it installed.
23  docs/modpython.txt
@@ -10,6 +10,8 @@ Python code into memory when the server starts. Code stays in memory throughout
10 10
 the life of an Apache process, which leads to significant performance gains over
11 11
 other server arrangements.
12 12
 
  13
+Django requires Apache 2.x and mod_python 3.x.
  14
+
13 15
 .. _Apache: http://httpd.apache.org/
14 16
 .. _mod_python: http://www.modpython.org/
15 17
 .. _mod_perl: http://perl.apache.org/
@@ -129,7 +131,26 @@ particular part of the site::
129 131
         SetHandler None
130 132
     </Location>
131 133
 
132  
-Just change ``Location`` to the root URL of your media files.
  134
+Just change ``Location`` to the root URL of your media files. You can also use
  135
+``<LocationMatch>`` to match a regular expression.
  136
+
  137
+This example sets up Django at the site root but explicitly disables Django for
  138
+the ``media`` subdirectory and any URL that ends with ``.jpg``, ``.gif`` or
  139
+``.png``::
  140
+
  141
+    <Location "/">
  142
+        SetHandler python-program
  143
+        PythonHandler django.core.handlers.modpython
  144
+        SetEnv DJANGO_SETTINGS_MODULE myproject.settings
  145
+    </Location>
  146
+
  147
+    <Location "media">
  148
+        SetHandler None
  149
+    </Location>
  150
+
  151
+    <LocationMatch "\.(jpg|gif|png)$">
  152
+        SetHandler None
  153
+    </Location>
133 154
 
134 155
 Note that the Django development server automagically serves admin media files,
135 156
 but this is not the case when you use any other server arrangement.

0 notes on commit 54c3367

Please sign in to comment.
Something went wrong with that request. Please try again.