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.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.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

class Widget(attrs=None) [source] This abstract class cannot be rendered, but provides the basic attribute attrs. You may also implement or override the render() method on custom widgets. attrs A dictionary containing HTML attributes to be set on the rendered widget. >>> from django import forms >>> name = forms.TextInput(attrs={'size': 10, 'title': 'Your name',}) >>> name.render('name', 'A name') '<input title="Your name" type="text" name="name" value="A nam

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.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.