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 an
10 appropriate configuration of Apache or the prefork method
11 when using FastCGI through another Web server.
15 In this section there are some example ``VirtualHost`` directives for
16 when deploying using either ``mod_python`` or ``mod_wsgi``. At this
17 time, we recommend ``mod_wsgi``, as it is now officially recommended
18 way to deploy Django applications with Apache. Moreover, if
19 ``mod_python`` is used, then a prefork version of Apache must also be
20 used. As long as ``mod_wsgi`` is configured correctly, it does not
21 matter whether the version of Apache is prefork or worker.
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.
36 WSGIDaemonProcess geodjango user=geo group=geo processes=5 threads=1
37 WSGIProcessGroup geodjango
38 WSGIScriptAlias / /home/geo/geodjango/world.wsgi
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/">
45 IndexOptions FancyIndexing
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.
56 For more information, please consult Django's
57 :doc:`mod_wsgi documentation </howto/deployment/wsgi/modwsgi>`.
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/wsgi/modwsgi>` or any of
66 the other :doc:`supported servers </howto/deployment/index>`.
74 PythonHandler django.core.handlers.modpython
75 SetEnv DJANGO_SETTINGS_MODULE world.settings
77 PythonPath "['/var/www/apps'] + sys.path"
80 Alias /media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
89 When using ``mod_python`` you *must* be using a prefork version of Apache, or
90 else your GeoDjango application may crash Apache.
92 For more information, please consult Django's
93 :doc:`mod_python documentation </howto/deployment/modpython>`.