summaryrefslogtreecommitdiff
path: root/parts/django/docs/ref/contrib/gis/deployment.txt
blob: 035b23fc8e0547f1c36e348c721e4a7d3b2861ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
===================
Deploying GeoDjango
===================

.. warning::

    GeoDjango uses the GDAL geospatial library which is
    not thread safe at this time.  Thus, it is *highly* recommended
    to not use threading when deploying -- in other words, use a 
    an appropriate configuration of Apache or the prefork method
    when using FastCGI through another Web server.

Apache
======
In this section there are some example ``VirtualHost`` directives for 
when deploying using either ``mod_python`` or ``mod_wsgi``.  At this
time, we recommend ``mod_wsgi``, as it is now officially recommended 
way to deploy Django applications with Apache.  Moreover, if
``mod_python`` is used, then a prefork version of Apache must also be
used.  As long as ``mod_wsgi`` is configured correctly, it does not
matter whether the version of Apache is prefork or worker.

.. note::

    The ``Alias`` and ``Directory`` configurations in the the examples
    below use an example path to a system-wide installation folder of Django.  
    Substitute in an appropriate location, if necessary, as it may be
    different than the path on your system.

``mod_wsgi``
------------

Example::

    <VirtualHost *:80>
      WSGIDaemonProcess geodjango user=geo group=geo processes=5 threads=1
      WSGIProcessGroup geodjango
      WSGIScriptAlias / /home/geo/geodjango/world.wsgi
  
      Alias /media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
      <Directory "/usr/lib/python2.5/site-packages/django/contrib/admin/media/">
        Order allow,deny
        Options Indexes
        Allow from all
        IndexOptions FancyIndexing
      </Directory>
    
    </VirtualHost>

.. warning::

    If the ``WSGIDaemonProcess`` attribute ``threads`` is not set to ``1``, then
    Apache may crash when running your GeoDjango application.  Increase the 
    number of ``processes`` instead.

For more information, please consult Django's
:doc:`mod_wsgi documentation </howto/deployment/modwsgi>`.

``mod_python``
--------------

Example::

    <VirtualHost *:80>
    
      <Location "/">
        SetHandler mod_python
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE world.settings
        PythonDebug On
        PythonPath "['/var/www/apps'] + sys.path"
      </Location>
    
      Alias /media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
      <Location "/media">
        SetHandler None
      </Location>
    
    </VirtualHost>

.. warning::

   When using ``mod_python`` you *must* be using a prefork version of Apache, or
   else your GeoDjango application may crash Apache.

For more information, please consult Django's
:doc:`mod_python documentation </howto/deployment/modpython>`.

Lighttpd
========

FastCGI
-------

Nginx
=====

FastCGI
-------