From c8b4f7518db38ecfca0123adc13b4adab03956fb Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 3 Oct 2011 21:25:06 +0200 Subject: [PATCH] Fix of admin setup for DEBUG=False, based on https://code.djangoproject.com/ticket/10405#comment:11 (thanks to catch22 for finding this) --- src/web/urls.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/web/urls.py b/src/web/urls.py index 4393644547..067f52a0d1 100755 --- a/src/web/urls.py +++ b/src/web/urls.py @@ -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()