From c8c59c812c0cff2f473bdb0ea3af242efd298369 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 16 Mar 2012 21:41:19 +0000 Subject: [PATCH] Fixed #13267 -- Updated GeoDjango tutorial for the 1.4 release. Thanks samueladam for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17754 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/contrib/gis/tutorial.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt index eebd50a1af..ac4df64eb6 100644 --- a/docs/ref/contrib/gis/tutorial.txt +++ b/docs/ref/contrib/gis/tutorial.txt @@ -100,8 +100,8 @@ the ``geodjango`` project: Configure ``settings.py`` ------------------------- -The ``geodjango`` project settings are stored in the ``settings.py`` file. Edit -the database connection settings appropriately:: +The ``geodjango`` project settings are stored in the ``geodjango/settings.py`` +file. Edit the database connection settings appropriately:: DATABASES = { 'default': { @@ -111,10 +111,6 @@ the database connection settings appropriately:: } } -.. note:: - - These database settings are for Django 1.2 and above. - In addition, modify the :setting:`INSTALLED_APPS` setting to include :mod:`django.contrib.admin`, :mod:`django.contrib.gis`, and ``world`` (our newly created application):: @@ -124,6 +120,8 @@ and ``world`` (our newly created application):: 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.gis', 'world' @@ -362,7 +360,7 @@ tutorial, then we can determine the path using Python's built-in Now, the world borders shapefile may be opened using GeoDjango's :class:`~django.contrib.gis.gdal.DataSource` interface:: - >>> from django.contrib.gis.gdal import * + >>> from django.contrib.gis.gdal import DataSource >>> ds = DataSource(world_shp) >>> print ds / ... /geodjango/world/data/TM_WORLD_BORDERS-0.3.shp (ESRI Shapefile) @@ -648,7 +646,7 @@ example, the coordinate will be expressed in terms of `EPSG SRID 32140`__, a coordinate system specific to south Texas **only** and in units of **meters** and not degrees:: - >>> from django.contrib.gis.geos import * + >>> from django.contrib.gis.geos import Point, GEOSGeometry >>> pnt = Point(954158.1, 4215137.1, srid=32140) Note that ``pnt`` may also be constructed with EWKT, an "extended" form of @@ -729,7 +727,7 @@ Let's dive in again -- create a file called ``admin.py`` inside the admin.site.register(WorldBorder, admin.GeoModelAdmin) -Next, edit your ``urls.py`` in the ``geodjango`` project folder to look +Next, edit your ``urls.py`` in the ``geodjango`` application folder to look as follows:: from django.conf.urls import patterns, url, include @@ -738,7 +736,7 @@ as follows:: admin.autodiscover() urlpatterns = patterns('', - (r'^admin/', include(admin.site.urls)), + url(r'^admin/', include(admin.site.urls)), ) Start up the Django development server: