Ticket #9970: wsgi-docs.diff

File wsgi-docs.diff, 4.8 KB (added by Alex Gaynor, 9 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
    1414   modpython
     15   modwsgi
    1516   fastcgi
    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.
    2122.. seealso::
    2324    * `Chapter 20 of The Django Book`_ discusses deployment and especially
    2425      scaling in more detail.
    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.
    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:
     4How to use Django with Apache and mod_wsgi
     7Apache_ with `mod_wsgi`_ is one of the reccomended ways for using Django in
     10.. _Apache: http://httpd.apache.org/
     11.. _mod_wsgi: http://code.google.com/p/modwsgi/
     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.
     17.. _PEP 333: http://www.python.org/dev/peps/pep-0333/
     19Basic Configuration
     22First make sure you have Apache installed, and mod_wsgi installed and activated. 
     23Next edit your ``httpd.conf`` file and add::
     25    WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi
     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::
     34    import os
     35    import sys
     37    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
     39    import django.core.handlers.wsgi
     40    application = django.core.handlers.wsgi.WSGIHandler()
     42If your project is not on your PYTHONPATH by default you can add::
     44    sys.path.append('/usr/local/django')
     46to place it on the path.  Also replace 'mysite.settings' with your settings file.
     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.
     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>`
    7878Other batteries included
Back to Top