django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.89k stars 954 forks source link

Clarification of import in GeoDjango tutorial #1142

Closed Kellytubby closed 2 years ago

Kellytubby commented 2 years ago

Hi,

I 'think this section requires an edit: https://docs.djangoproject.com/en/4.0/ref/contrib/gis/tutorial/#gismodeladmin

In order for admin.GISModelAdmin to be found, it needs to be imported from django.contrib.gis, not from django.contrib from where ModelAdmin is imported in the previous code snippet.

Otherwise: AttributeError: module 'django.contrib.admin' has no attribute 'GISModelAdmin'

Hope I'm correct [learning] and hope this helps, IK

felixxm commented 2 years ago

GISModelAdmin should be imported from django.contrib.gis.admin, as in the admin.py example on this page. Moreover, this is the issue tracker for the djangoproject.com website. Please see TicketClosingReasons/UseSupportChannels for ways to get help with Django usage.