Author: jacob Date: 2009-03-31 17:06:06 -0500 (Tue, 31 Mar 2009) New Revision: 10300
Added: django/branches/releases/1.0.X/docs/howto/deployment/modwsgi.txt Modified: django/branches/releases/1.0.X/ django/branches/releases/1.0.X/docs/howto/deployment/index.txt Log: [1.0.X] Fixed #9970: added mod_wsgi docs. Thanks, Alex Gaynor. Backport of r10280 from trunk. Property changes on: django/branches/releases/1.0.X ___________________________________________________________________ Name: svnmerge-integrated - /django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054,10056-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10279,10282-10283 + /django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990,9992,9994,9996-9998,10003,10007,10009,10013,10015,10017,10022,10024,10031,10036-10037,10040,10049,10051,10054,10056-10058,10071,10073-10074,10078,10104,10125,10136,10139,10143,10145-10147,10149-10152,10170,10175,10193,10195-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10283 Modified: django/branches/releases/1.0.X/docs/howto/deployment/index.txt =================================================================== --- django/branches/releases/1.0.X/docs/howto/deployment/index.txt 2009-03-31 22:04:15 UTC (rev 10299) +++ django/branches/releases/1.0.X/docs/howto/deployment/index.txt 2009-03-31 22:06:06 UTC (rev 10300) @@ -11,23 +11,17 @@ .. toctree:: :maxdepth: 1 + modwsgi modpython fastcgi -:ref:`Deploying under mod_python <howto-deployment-modpython>` is the -recommended deployment method; start there if you're not sure which path you'd -like to go down. +If you're new to deploying Django and/or Python, we'd recommend you try +:ref:`mod_wsgi <howto-deployment-modwsgi>` first. In most cases it'll be the easiest, +fastest, and most stable deployment choice. .. seealso:: * `Chapter 20 of The Django Book`_ discusses deployment and especially scaling in more detail. - * `mod_wsgi`_ is a newcomer to the Python deployment world, but it's rapidly - gaining traction. Currently there's a few hoops you have to jump through to - `use mod_wsgi with Django`_, but mod_wsgi tends to get rave reviews from - those who use it. - .. _chapter 20 of the django book: http://djangobook.com/en/1.0/chapter20/ -.. _mod_wsgi: http://code.google.com/p/modwsgi/ -.. _use mod_wsgi with Django: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango \ No newline at end of file Copied: django/branches/releases/1.0.X/docs/howto/deployment/modwsgi.txt (from rev 10280, django/trunk/docs/howto/deployment/modwsgi.txt) =================================================================== --- django/branches/releases/1.0.X/docs/howto/deployment/modwsgi.txt (rev 0) +++ django/branches/releases/1.0.X/docs/howto/deployment/modwsgi.txt 2009-03-31 22:06:06 UTC (rev 10300) @@ -0,0 +1,68 @@ +.. _howto-deployment-modwsgi: + +========================================== +How to use Django with Apache and mod_wsgi +========================================== + +Deploying Django with Apache_ and `mod_wsgi`_ is the recommended way to get +Django into production. + +.. _Apache: http://httpd.apache.org/ +.. _mod_wsgi: http://code.google.com/p/modwsgi/ + +mod_wsgi is an Apache module which can be used to host any Python application +which supports the `Python WSGI interface`_, including Django. Django will work +with any version of Apache which supports mod_wsgi. + +.. _python wsgi interface: http://www.python.org/dev/peps/pep-0333/ + +The `official mod_wsgi documentation`_ is fantastic; it's your source for all +the details about how to use mod_wsgi. You'll probably want to start with the +`installation and configuration documentation`_. + +.. _official mod_wsgi documentation: http://code.google.com/p/modwsgi/ +.. _installation and configuration documentation: http://code.google.com/p/modwsgi/wiki/InstallationInstructions + +Basic Configuration +=================== + +Once you've got mod_wsgi installed and activated, edit your ``httpd.conf`` file +and add:: + + WSGIScriptAlias / /path/to/mysite/apache/django.wsgi + +The first bit aboveis the url you want to be serving your application at (``/`` +indicates the root url), and the second is the location of a "WSGI file" -- see +below -- on your system, usually inside of your project. This tells Apache +to serve any request below the given URL using the WSGI application defined by that file. + +Next we'll need to actually create this WSGI application, so create the file +mentioned in the second part of ``WSGIScriptAlias`` and add:: + + import os + import sys + + os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' + + import django.core.handlers.wsgi + application = django.core.handlers.wsgi.WSGIHandler() + +If your project is not on your ``PYTHONPATH`` by default you can add:: + + sys.path.append('/usr/local/django') + +just above the ``import`` line to place your project on the path. Remember to +replace 'mysite.settings' with your correct settings file. + +See the :ref:`Apache/mod_python documentation<howto-deployment-modpython>` for +directions on serving static media, and the `mod_wsgi documentation`_ for an +explanation of other directives and configuration options you can use. + +Details +======= + +For more details, see the `mod_wsgi documentation`_, which explains the above in +more detail, and walks through all the various options you've got when deploying +under mod_wsgi. + +.. _mod_wsgi documentation: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango \ No newline at end of file --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---