Changes from Version 1 of GeoDjango

Show
Ignore:
Author:
jlivni (IP: 64.81.161.197)
Timestamp:
02/24/08 23:47:03 (3 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjango

    v0 v1  
     1GeoDjango has some great documentation, but there are still some areas that are missing, especially some simple examples for Django noobs. 
     2 
     3First, check which branch you're using.  As of 2/24/08, The gis branch in the main django svn lags a bit behind some of the work being done on the gis-newforms branch, available at select mercurial repositories near you (find out which to use by asking the developers on #geodjango).  This example is for use with the latest gis-newforms. 
     4 
     5Next, follow the excellent [http://code.djangoproject.com/wiki/GeoDjangoInstall official install instructions].  If you already have a box with all the software described [UbuntuBaseStackSource  here], you just need to softlink your site-packages/django to the gis-newforms/django that you downloaded.  Now, you should have GeoDjango available (see their install instructions page above to test this), and so we can start building a basic site.   
     6 
     7The example site we'll build will be an app with Counties (which we will import from a shapefile), and Locations, which will reside within a county.  When we add a location, it should automatically get assigned an appropriate County.  We will create a basic kml view of the locations for display in Google Earth, and an OpenLayer based map view. 
     8 
     9create the site and app 
     10{{{ 
     11django-admin.py startproject geosite 
     12cd geosite 
     13python manage.py createapp geoapp 
     14}}} 
     15 
     16next, let's get us some URL's, by modifying urls.py: 
     17{{{ 
     18#urls.py 
     19 
     20 
     21 
     22}}} 
     23 
     24and make some models: 
     25{{{ 
     26#geoapp/models.py 
     27 
     28}}} 
     29 
     30and, some views: 
     31#geoapp/views.py 
     32{{{ 
     33 
     34 
     35}}} 
     36finally, the templates: 
     37{{{ 
     38#geoapp/templates/placemarks.kml 
     39 
     40 
     41}}} 
     42and 
     43{{{ 
     44#geoapp/templates/base.kml 
     45 
     46 
     47}}}