Fix of admin setup for DEBUG=False, based on https://code.djangoproject.com/ticket/10405#comment:11 (thanks to catch22 for finding this)
This commit is contained in:
parent
bf72239dc9
commit
c8b4f7518d
1 changed files with 7 additions and 1 deletions
|
|
@ -10,8 +10,14 @@ from django.conf.urls.defaults import *
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# fix to resolve lazy-loading bug
|
||||||
|
# https://code.djangoproject.com/ticket/10405#comment:11
|
||||||
|
from django.db.models.loading import cache as model_cache
|
||||||
|
if not model_cache.loaded:
|
||||||
|
model_cache.get_models()
|
||||||
|
|
||||||
# loop over all settings.INSTALLED_APPS and execute code in
|
# loop over all settings.INSTALLED_APPS and execute code in
|
||||||
# files named admin.py ine each such app (this will add those
|
# files named admin.py in each such app (this will add those
|
||||||
# models to the admin site)
|
# models to the admin site)
|
||||||
admin.autodiscover()
|
admin.autodiscover()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue