summaryrefslogtreecommitdiff
path: root/docs/modpython.txt
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-27 12:45:14 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-27 12:45:14 +0000
commitb0b5023313eae66c0ed3642cff1a4abae1d7da69 (patch)
tree48a112bc5856bbe4c84807ca835ae56d564cac12 /docs/modpython.txt
parenta4e3581dfc8e16970014d1ecf5b9d6af7e4f46f4 (diff)
Fixed #4150 -- Added an explanation of how to use eggs with mod_python.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5363 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/modpython.txt')
-rw-r--r--docs/modpython.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/modpython.txt b/docs/modpython.txt
index 37909a09fd..43c5791be5 100644
--- a/docs/modpython.txt
+++ b/docs/modpython.txt
@@ -211,6 +211,41 @@ Here are two recommended approaches:
2. Or, copy the admin media files so that they live within your Apache
document root.
+Using eggs with mod_python
+==========================
+
+If you installed Django from a Python egg_ or are using eggs in your Django
+project, some extra configuration is required. Create an extra file in your
+project (or somewhere else) that contains something like the following::
+
+ import os
+ os.environ['PYTHON_EGG_CACHE'] = '/some/directory'
+
+Here, ``/some/directory`` is a directory that the Apache webserver process can
+write to. It will be used as the location for any unpacking of code the eggs
+need to do.
+
+Then you have to tell mod_python to import this file before doing anything
+else. This is done using the PythonImport_ directive to mod_python. You need
+to ensure that you have specified the ``PythonInterpreter`` directive to
+mod_python as described above__ (you need to do this even if you aren't
+serving multiple installations in this case). Then add the ``PythonImport``
+line inside the ``Location`` or ``VirtualHost`` section. For example::
+
+ PythonInterpreter my_django
+ PythonImport /path/to/my/project/file.py my_django
+
+Note that you can use an absolute path here (or a normal dotted import path),
+as described in the `mod_python manual`_. We use an absolute path in the
+above example because if any Python path modifications are required to access
+your project, they will not have been done at the time the ``PythonImport``
+line is processed.
+
+.. _Egg: http://peak.telecommunity.com/DevCenter/PythonEggs
+.. _PythonImport: http://www.modpython.org/live/current/doc-html/dir-other-pimp.html
+.. _mod_python manual: PythonImport_
+__ `Multiple Django installations on the same Apache`_
+
Error handling
==============
@@ -256,3 +291,5 @@ as necessary.
.. _Expat Causing Apache Crash: http://www.dscpl.com.au/articles/modpython-006.html
.. _mod_python FAQ entry: http://modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp
.. _Getting mod_python Working: http://www.dscpl.com.au/articles/modpython-001.html
+
+