PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/ref/contrib/gis/deployment.txt

https://code.google.com/p/mango-py/
Plain Text | 105 lines | 78 code | 27 blank | 0 comment | 0 complexity | e572bb8672fb6e5ecfcb8c018d614aaa MD5 | raw file
  1===================
  2Deploying GeoDjango
  3===================
  4
  5.. warning::
  6
  7    GeoDjango uses the GDAL geospatial library which is
  8    not thread safe at this time.  Thus, it is *highly* recommended
  9    to not use threading when deploying -- in other words, use a
 10    an appropriate configuration of Apache or the prefork method
 11    when using FastCGI through another Web server.
 12
 13Apache
 14======
 15In this section there are some example ``VirtualHost`` directives for
 16when deploying using either ``mod_python`` or ``mod_wsgi``.  At this
 17time, we recommend ``mod_wsgi``, as it is now officially recommended
 18way to deploy Django applications with Apache.  Moreover, if
 19``mod_python`` is used, then a prefork version of Apache must also be
 20used.  As long as ``mod_wsgi`` is configured correctly, it does not
 21matter whether the version of Apache is prefork or worker.
 22
 23.. note::
 24
 25    The ``Alias`` and ``Directory`` configurations in the examples
 26    below use an example path to a system-wide installation folder of Django.
 27    Substitute in an appropriate location, if necessary, as it may be
 28    different than the path on your system.
 29
 30``mod_wsgi``
 31------------
 32
 33Example::
 34
 35    <VirtualHost *:80>
 36      WSGIDaemonProcess geodjango user=geo group=geo processes=5 threads=1
 37      WSGIProcessGroup geodjango
 38      WSGIScriptAlias / /home/geo/geodjango/world.wsgi
 39
 40      Alias /media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
 41      <Directory "/usr/lib/python2.5/site-packages/django/contrib/admin/media/">
 42        Order allow,deny
 43        Options Indexes
 44        Allow from all
 45        IndexOptions FancyIndexing
 46      </Directory>
 47
 48    </VirtualHost>
 49
 50.. warning::
 51
 52    If the ``WSGIDaemonProcess`` attribute ``threads`` is not set to ``1``, then
 53    Apache may crash when running your GeoDjango application.  Increase the
 54    number of ``processes`` instead.
 55
 56For more information, please consult Django's
 57:doc:`mod_wsgi documentation </howto/deployment/modwsgi>`.
 58
 59``mod_python``
 60--------------
 61
 62.. warning::
 63    Support for mod_python will be deprecated in a future release of Django. If
 64    you are configuring a new deployment, you are strongly encouraged to
 65    consider using :doc:`mod_wsgi </howto/deployment/modwsgi>` or any of the
 66    other :doc:`supported backends </howto/deployment/index>`.
 67
 68Example::
 69
 70    <VirtualHost *:80>
 71
 72      <Location "/">
 73        SetHandler mod_python
 74        PythonHandler django.core.handlers.modpython
 75        SetEnv DJANGO_SETTINGS_MODULE world.settings
 76        PythonDebug On
 77        PythonPath "['/var/www/apps'] + sys.path"
 78      </Location>
 79
 80      Alias /media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
 81      <Location "/media">
 82        SetHandler None
 83      </Location>
 84
 85    </VirtualHost>
 86
 87.. warning::
 88
 89   When using ``mod_python`` you *must* be using a prefork version of Apache, or
 90   else your GeoDjango application may crash Apache.
 91
 92For more information, please consult Django's
 93:doc:`mod_python documentation </howto/deployment/modpython>`.
 94
 95Lighttpd
 96========
 97
 98FastCGI
 99-------
100
101Nginx
102=====
103
104FastCGI
105-------