#22832 closed Uncategorized (invalid)
admin.autodiscover() missing
Reported by: | Matej | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
in the geoDjango tutorial: https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/
close to the bottom of the page there is this block of code:
from django.conf.urls import url, include
from django.contrib.gis import admin
urlpatterns = [
url(r'admin/', include(admin.site.urls)),
]
that should have also included the following line:
admin.autodiscover()
otherwise, the admin page says: you don't have permission to edit anything.
Matej
Change History (2)
comment:1 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
Due to the new app loading mechanism introduced in 1.7, django will do the autodiscover automatically.
See https://docs.djangoproject.com/en/1.7/ref/applications/ for more about the app loading process.
And the release notes https://docs.djangoproject.com/en/1.7/releases/1.7/#app-loading-refactor for information on what effects this new mechanism has.
Please https://docs.djangoproject.com/en/1.6/ref/contrib/gis/tutorial/ if you are using Django 1.6. That line is no longer necessary in Django 1.7+.