GeoDjango Installation

Overview In general, GeoDjango installation requires: Python and Django Spatial database Installing Geospatial libraries Details for each of the requirements and installation instructions are provided in the sections below. In addition, platform-specific instructions are available for: Mac OS X Windows Use the Source Because GeoDjango takes advantage of the latest in the open source geospatial software technology, recent versions of the libraries are necessary. If binary packages aren’t av

GeoDjango Database API

Spatial Backends GeoDjango currently provides the following spatial database backends: django.contrib.gis.db.backends.postgis django.contrib.gis.db.backends.mysql django.contrib.gis.db.backends.oracle django.contrib.gis.db.backends.spatialite MySQL Spatial Limitations MySQL’s spatial extensions only support bounding box operations (what MySQL calls minimum bounding rectangles, or MBR). Specifically, MySQL does not conform to the OGC standard: Currently, MySQL does not implement these functi

GeoDjango

GeoDjango intends to be a world-class geographic Web framework. Its goal is to make it as easy as possible to build GIS Web applications and harness the power of spatially enabled data. GeoDjango TutorialIntroduction Setting Up Geographic Data Geographic Models Importing Spatial Data Spatial Queries Putting your data on the map GeoDjango InstallationOverview Requirements Installation Troubleshooting Platform-specific instructions GeoDjango Model APISpatial Field Types Spatial Field Options

Generic views

See Built-in class-based views API.

forms.Widget.value_omitted_from_data()

value_omitted_from_data(data, files, name) [source] New in Django 1.10.2. Given data and files dictionaries and this widget’s name, returns whether or not there’s data or files for the widget. The method’s result affects whether or not a field in a model form falls back to its default. Special cases are CheckboxInput and CheckboxSelectMultiple, which always return False because an unchecked checkbox doesn’t appear in the data of an HTML form submission, so it’s unknown whether or not the u

forms.Widget.value_from_datadict()

value_from_datadict(data, files, name) [source] Given a dictionary of data and this widget’s name, returns the value of this widget. files may contain data coming from request.FILES. Returns None if a value wasn’t provided. Note also that value_from_datadict may be called more than once during handling of form data, so if you customize it and add expensive processing, you should implement some caching mechanism yourself.

forms.Widget.supports_microseconds

supports_microseconds An attribute that defaults to True. If set to False, the microseconds part of datetime and time values will be set to 0. New in Django 1.9: In older versions, this attribute was only defined on the date and time widgets (as False).

forms.Widget.render()

render(name, value, attrs=None) [source] Returns HTML for the widget, as a Unicode string. This method must be implemented by the subclass, otherwise NotImplementedError will be raised. The ‘value’ given is not guaranteed to be valid input, therefore subclass implementations should program defensively.

forms.Widget.id_for_label()

id_for_label(self, id_) [source] Returns the HTML ID attribute of this widget for use by a <label>, given the ID of the field. Returns None if an ID isn’t available. This hook is necessary because some widgets have multiple HTML elements and, thus, multiple IDs. In that case, this method should return an ID value that corresponds to the first ID in the widget’s tags.

forms.Widget.format_value()

format_value(value) Cleans and returns a value for use in the widget template. value isn’t guaranteed to be valid input, therefore subclass implementations should program defensively. Changed in Django 1.10: In older versions, this method is a private API named _format_value(). The old name will work until Django 2.0.