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:
Griatch 2011-10-03 21:25:06 +02:00
parent bf72239dc9
commit c8b4f7518d

View file

@ -10,8 +10,14 @@ from django.conf.urls.defaults import *
from django.conf import settings
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
# 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)
admin.autodiscover()