Ticket #9970: wsgi-docs.diff
File wsgi-docs.diff, 4.8 KB (added by , 16 years ago) |
---|
-
docs/howto/deployment/index.txt
diff --git a/docs/howto/deployment/index.txt b/docs/howto/deployment/index.txt index 80c16fc..538d52a 100644
a b ways to easily deploy Django: 12 12 :maxdepth: 1 13 13 14 14 modpython 15 modwsgi 15 16 fastcgi 16 17 17 :ref:`Deploying under mod_python <howto-deployment-modpython>` is the 18 recommended deployment method; start there if you're not sure which path you'd 19 like to go down.18 Deploying under either :ref:`mod_python <howto-deployment-modpython>` or 19 :ref:`mod_wsgi <howto-deployment-modwsgi>` is the recommended deployment method; 20 start with one them if you're not sure which path you'd like to go down. 20 21 21 22 .. seealso:: 22 23 23 24 * `Chapter 20 of The Django Book`_ discusses deployment and especially 24 25 scaling in more detail. 25 26 26 * `mod_wsgi`_ is a newcomer to the Python deployment world, but it's rapidly27 gaining traction. Currently there's a few hoops you have to jump through to28 `use mod_wsgi with Django`_, but mod_wsgi tends to get rave reviews from29 those who use it.30 31 27 .. _chapter 20 of the django book: http://djangobook.com/en/1.0/chapter20/ 32 .. _mod_wsgi: http://code.google.com/p/modwsgi/33 .. _use mod_wsgi with Django: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango34 No newline at end of file -
new file docs/howto/deployment/modwsgi.txt
diff --git a/docs/howto/deployment/modwsgi.txt b/docs/howto/deployment/modwsgi.txt new file mode 100644 index 0000000..4832a98
- + 1 .. _howto-deployment-modwsgi: 2 3 ========================================== 4 How to use Django with Apache and mod_wsgi 5 ========================================== 6 7 Apache_ with `mod_wsgi`_ is one of the reccomended ways for using Django in 8 production. 9 10 .. _Apache: http://httpd.apache.org/ 11 .. _mod_wsgi: http://code.google.com/p/modwsgi/ 12 13 mod_wsgi is an Apache module which can be used to host any Python application 14 which supports the Python WSGI interface (`PEP 333`_), including Django. Django 15 will work with any version of Apache which supports mod_wsgi. 16 17 .. _PEP 333: http://www.python.org/dev/peps/pep-0333/ 18 19 Basic Configuration 20 =================== 21 22 First make sure you have Apache installed, and mod_wsgi installed and activated. 23 Next edit your ``httpd.conf`` file and add:: 24 25 WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi 26 27 Where the first path is the url you want to be serving your application at (/ 28 indicates the root url), and the second is the location of a WSGI file (to be 29 explained momentarily) on your system, usually inside of your project. This 30 will tell Apache to serve any request at that URL using WSGI, configured with 31 that file. Next we create our WSGI file, at the location we just indicated and 32 put in it:: 33 34 import os 35 import sys 36 37 os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' 38 39 import django.core.handlers.wsgi 40 application = django.core.handlers.wsgi.WSGIHandler() 41 42 If your project is not on your PYTHONPATH by default you can add:: 43 44 sys.path.append('/usr/local/django') 45 46 to place it on the path. Also replace 'mysite.settings' with your settings file. 47 48 See the :ref:`Apache/mod_python documentation<howto-deployment-modpython>` for 49 directions on serving static media, and the `mod_wsgi documentation`_ for an 50 explanation of other directives and configuration options you can use. 51 52 .. _mod_wsgi documentation: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango 53 No newline at end of file -
docs/index.txt
diff --git a/docs/index.txt b/docs/index.txt index dc060b7..0cc2e21 100644
a b The development process 73 73 * **Settings:** :ref:`Overview <topics-settings>` | :ref:`Full list of settings <ref-settings>` 74 74 * **django-admin.py and manage.py:** :ref:`Overview <ref-django-admin>` | :ref:`Adding custom commands <howto-custom-management-commands>` 75 75 * **Testing:** :ref:`Overview <topics-testing>` 76 * **Deployment:** :ref:`Overview <howto-deployment-index>` | :ref:`Apache/mod_python <howto-deployment-modpython>` | :ref:` FastCGI/SCGI/AJP <howto-deployment-fastcgi>` | :ref:`Apache authentication <howto-apache-auth>` | :ref:`Serving static files <howto-static-files>` | :ref:`Tracking code errors by e-mail <howto-error-reporting>`76 * **Deployment:** :ref:`Overview <howto-deployment-index>` | :ref:`Apache/mod_python <howto-deployment-modpython>` | :ref:`Apache/mod_wsgi <howto-deployment-modwsgi>` | :ref:`FastCGI/SCGI/AJP <howto-deployment-fastcgi>` | :ref:`Apache authentication <howto-apache-auth>` | :ref:`Serving static files <howto-static-files>` | :ref:`Tracking code errors by e-mail <howto-error-reporting>` 77 77 78 78 Other batteries included 79 79 ========================