How to use Django with Apache and mod_wsgi

Deploying Django with Apache and mod_wsgi is a tried and tested way to get Django into production. mod_wsgi is an Apache module which can host any Python WSGI application, including Django. Django will work with any version of Apache which supports mod_wsgi. The official mod_wsgi documentation is fantastic; it’s your source for all the details about how to use mod_wsgi. You’ll probably want to start with the installation and configuration documentation. Basic configuration Once you’ve got mod_w

gis.widgets.OSMWidget

class OSMWidget This widget uses an OpenStreetMap base layer (Mapnik) to display geographic objects on. template_name is gis/openlayers-osm.html. The OpenLayersWidget note about JavaScript file hosting above also applies here. See also this FAQ answer about https access to map tiles.

gis.widgets.BaseGeometryWidget.template_name

BaseGeometryWidget.template_name The template used to render the map widget. You can pass widget attributes in the same manner that for any other Django widget. For example: from django.contrib.gis import forms class MyGeoForm(forms.Form): point = forms.PointField(widget= forms.OSMWidget(attrs={'map_width': 800, 'map_height': 500}))

gis.widgets.OpenLayersWidget

class OpenLayersWidget This is the default widget used by all GeoDjango form fields. template_name is gis/openlayers.html. OpenLayersWidget and OSMWidget use the openlayers.js file hosted on the openlayers.org website. This works for basic usage during development, but isn’t appropriate for a production deployment as openlayers.org/api/ has no guaranteed uptime and runs on a slow server. You are therefore advised to subclass these widgets in order to specify your own version of the openlayer

How to deploy with WSGI

Django’s primary deployment platform is WSGI, the Python standard for web servers and applications. Django’s startproject management command sets up a simple default WSGI configuration for you, which you can tweak as needed for your project, and direct any WSGI-compliant application server to use. Django includes getting-started documentation for the following WSGI servers: How to use Django with Apache and mod_wsgi Authenticating against Django’s user database from Apache How to use Django wi

Handling HTTP requests

Information on handling HTTP requests in Django: URL dispatcher Writing views View decorators File Uploads Django shortcut functions Generic views Middleware How to use sessions

gis.widgets.BaseGeometryWidget.geom_type

BaseGeometryWidget.geom_type The OpenGIS geometry type, generally set by the form field.

gis.widgets.BaseGeometryWidget

class BaseGeometryWidget This is an abstract base widget containing the logic needed by subclasses. You cannot directly use this widget for a geometry field. Note that the rendering of GeoDjango widgets is based on a template, identified by the template_name class attribute. OpenLayersWidget

gis.widgets.BaseGeometryWidget.map_srid

BaseGeometryWidget.map_srid SRID code used by the map (default is 4326).

gis.widgets.BaseGeometryWidget.map_height

BaseGeometryWidget.map_height