Ticket #9970: wsgi-docs.diff

File wsgi-docs.diff, 4.8 KB (added by Alex Gaynor, 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:  
    1212   :maxdepth: 1
    1313   
    1414   modpython
     15   modwsgi
    1516   fastcgi
    1617   
    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.
     18Deploying under either :ref:`mod_python <howto-deployment-modpython>` or
     19:ref:`mod_wsgi <howto-deployment-modwsgi>` is the recommended deployment method;
     20start with one them if you're not sure which path you'd like to go down.
    2021
    2122.. seealso::
    2223
    2324    * `Chapter 20 of The Django Book`_ discusses deployment and especially
    2425      scaling in more detail.
    2526     
    26     * `mod_wsgi`_ is a newcomer to the Python deployment world, but it's rapidly
    27       gaining traction. Currently there's a few hoops you have to jump through to
    28       `use mod_wsgi with Django`_, but mod_wsgi tends to get rave reviews from
    29       those who use it.
    30 
    3127.. _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/IntegrationWithDjango
    34  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==========================================
     4How to use Django with Apache and mod_wsgi
     5==========================================
     6
     7Apache_ with `mod_wsgi`_ is one of the reccomended ways for using Django in
     8production.
     9
     10.. _Apache: http://httpd.apache.org/
     11.. _mod_wsgi: http://code.google.com/p/modwsgi/
     12
     13mod_wsgi is an Apache module which can be used to host any Python application
     14which supports the Python WSGI interface (`PEP 333`_), including Django.  Django
     15will work with any version of Apache which supports mod_wsgi.
     16
     17.. _PEP 333: http://www.python.org/dev/peps/pep-0333/
     18
     19Basic Configuration
     20===================
     21
     22First make sure you have Apache installed, and mod_wsgi installed and activated. 
     23Next edit your ``httpd.conf`` file and add::
     24
     25    WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi
     26
     27Where the first path is the url you want to be serving your application at (/
     28indicates the root url), and the second is the location of a WSGI file (to be
     29explained momentarily) on your system, usually inside of your project.  This
     30will tell Apache to serve any request at that URL using WSGI, configured with
     31that file.  Next we create our WSGI file, at the location we just indicated and
     32put 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
     42If your project is not on your PYTHONPATH by default you can add::
     43
     44    sys.path.append('/usr/local/django')
     45
     46to place it on the path.  Also replace 'mysite.settings' with your settings file.
     47
     48See the :ref:`Apache/mod_python documentation<howto-deployment-modpython>` for
     49directions on serving static media, and the `mod_wsgi documentation`_ for an
     50explanation 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  
    7373    * **Settings:** :ref:`Overview <topics-settings>` | :ref:`Full list of settings <ref-settings>`
    7474    * **django-admin.py and manage.py:** :ref:`Overview <ref-django-admin>` | :ref:`Adding custom commands <howto-custom-management-commands>`
    7575    * **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>`
    7777
    7878Other batteries included
    7979========================
Back to Top