1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-10-19 01:09:05 +00:00
parent fd3d579179
commit f07e5d4f5d
101 changed files with 141 additions and 376 deletions

View File

@@ -25,12 +25,11 @@ Then edit your ``httpd.conf`` file and add the following::
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonDebug On
</Location>
...and replace ``myproject.settings.main`` with the Python path to your
settings file.
...and replace ``myproject.settings`` with the Python path to your settings file.
This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the
Django mod_python handler." It passes the value of ``DJANGO_SETTINGS_MODULE``
@@ -55,17 +54,6 @@ full URL.
When deploying Django sites on mod_python, you'll need to restart Apache each
time you make changes to your Python code.
Here's a template for an admin configuration::
<Location "/admin/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
PythonDebug On
</Location>
The only thing different here is the ``DJANGO_SETTINGS_MODULE``.
Multiple Django installations on the same Apache
================================================
@@ -77,13 +65,13 @@ instance. Just use ``VirtualHost`` for that, like so::
<VirtualHost *>
ServerName www.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
</VirtualHost>
<VirtualHost *>
ServerName admin.example.com
ServerName www2.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings
</VirtualHost>
If you need to put two Django installations within the same ``VirtualHost``,
@@ -95,13 +83,13 @@ mess things up. Use the ``PythonInterpreter`` directive to give different
ServerName www.example.com
# ...
<Location "/something">
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
PythonInterpreter myproject_main
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonInterpreter myproject
</Location>
<Location "/admin">
SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
PythonInterpreter myproject_admin
<Location "/otherthing">
SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings
PythonInterpreter myproject_other
</Location>
</VirtualHost>