How to do it...

You will now create the front page of your web application, as follows:

  1. Go to the directory containing the Django wildlife web application and add the following lines to the urls.py file under chp09/wildlife/wildlife:
        from django.conf.urls import patterns, include, url         from django.conf import settings         from sightings.views import get_geojson, home         from django.contrib import admin         admin.autodiscover()         urlpatterns = [          url(r'^admin/', admin.site.urls),           url(r'^geojson/', get_geojson),           url(r'^$', home),         ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)           # media files
  1. Open the views.py file under chp09/wildlife/sightings and add the following code. The home view will return the home page of your application, ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.