Adding new installed apps

Within settings.py, scroll to the variable INSTALLED_APPS. This lists the built-in, core applications used to support our application. To it, we'll add django.contrib.gis, the built-in Django GIS application, and our own new application, Arenas.

INSTALLED_APPS is a list and can be edited. Initially, INSTALLED_APPS looks like this:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

Edit it to look like this:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
'arenas',
]

Save settings.py and close the script. Now we've added our custom arenas app and Django's GIS library to the installed app package manager, so GeoDjango is now configured. Next, we'll use manage.py and OGR to read shapefiles and automatically generate data models.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset