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