@@ -100,8 +100,8 @@ the ``geodjango`` project:
100
100
Configure ``settings.py``
101
101
-------------------------
102
102
103
- The ``geodjango`` project settings are stored in the ``settings.py`` file. Edit
104
- the database connection settings appropriately::
103
+ The ``geodjango`` project settings are stored in the ``geodjango/ settings.py``
104
+ file. Edit the database connection settings appropriately::
105
105
106
106
DATABASES = {
107
107
'default': {
@@ -111,10 +111,6 @@ the database connection settings appropriately::
111
111
}
112
112
}
113
113
114
- .. note::
115
-
116
- These database settings are for Django 1.2 and above.
117
-
118
114
In addition, modify the :setting:`INSTALLED_APPS` setting to include
119
115
:mod:`django.contrib.admin`, :mod:`django.contrib.gis`,
120
116
and ``world`` (our newly created application)::
@@ -124,6 +120,8 @@ and ``world`` (our newly created application)::
124
120
'django.contrib.contenttypes',
125
121
'django.contrib.sessions',
126
122
'django.contrib.sites',
123
+ 'django.contrib.messages',
124
+ 'django.contrib.staticfiles',
127
125
'django.contrib.admin',
128
126
'django.contrib.gis',
129
127
'world'
@@ -362,7 +360,7 @@ tutorial, then we can determine the path using Python's built-in
362
360
Now, the world borders shapefile may be opened using GeoDjango's
363
361
:class:`~django.contrib.gis.gdal.DataSource` interface::
364
362
365
- >>> from django.contrib.gis.gdal import *
363
+ >>> from django.contrib.gis.gdal import DataSource
366
364
>>> ds = DataSource(world_shp)
367
365
>>> print ds
368
366
/ ... /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`__,
648
646
a coordinate system specific to south Texas **only** and in units of
649
647
**meters** and not degrees::
650
648
651
- >>> from django.contrib.gis.geos import *
649
+ >>> from django.contrib.gis.geos import Point, GEOSGeometry
652
650
>>> pnt = Point(954158.1, 4215137.1, srid=32140)
653
651
654
652
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
729
727
730
728
admin.site.register(WorldBorder, admin.GeoModelAdmin)
731
729
732
- Next, edit your ``urls.py`` in the ``geodjango`` project folder to look
730
+ Next, edit your ``urls.py`` in the ``geodjango`` application folder to look
733
731
as follows::
734
732
735
733
from django.conf.urls import patterns, url, include
@@ -738,7 +736,7 @@ as follows::
738
736
admin.autodiscover()
739
737
740
738
urlpatterns = patterns('',
741
- (r'^admin/', include(admin.site.urls)),
739
+ url (r'^admin/', include(admin.site.urls)),
742
740
)
743
741
744
742
Start up the Django development server:
0 commit comments