Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No access to models in admin panel with DEBUG=False

I've some problem with access to models defined in my Django application. When I have in settings.py:

DEBUG = True
TEMPLATE_DEBUG = DEBUG

then everything works correctly. If I set DEBUG = False, then in admin panel I see section with my application name, and registered models, but the name of model isn't clickable (link) as normal. Also I don't see icon to add/edit objects to my registered models. Other standard applications as Auth, Flatpages looks ok. When I back set DEBUG = True, then everything works ok. Has anyone any idea what could be a reason of this issue?

like image 214
Grzegorz Avatar asked Oct 08 '12 11:10

Grzegorz


1 Answers

OK, I've found reason of my problems. It was caused by registering my models in admin panel from files with models definitions. When I moved all my registrations to one external file admin.py, then everything works correctly.

like image 123
Grzegorz Avatar answered Oct 16 '22 11:10

Grzegorz