admin.py

To access the data models stored in models.py through the administrative panel, the autogenerated script called admin.py inside the Arenas application must be updated. Open the file in an IDE and add the following lines, copying the original code:

from django.contrib.gis import adminfrom .models import US_States, Counties, Arenas, Districtsadmin.site.register(US_States, admin.GeoModelAdmin)admin.site.register(Counties, admin.GeoModelAdmin)admin.site.register(Arenas, admin.GeoModelAdmin)admin.site.register(Districts, admin.GeoModelAdmin)

Save the script and close it.

Get Mastering Geospatial Analysis with Python 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.