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 admin
from .models import US_States, Counties, Arenas, Districts
admin.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.

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

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