DEBUG=False running via mod_wsgi on Apache2 gives 500 error

58 views
Skip to first unread message

xyz69

unread,
Oct 1, 2009, 8:08:14 PM10/1/09
to Django FeinCMS
Hello,

I set up a apache(2.2.11) and mod_wsgi(2.3), python2.6. Everything was
fine untill I changed DEBUG variable in settings.py to False. Then
server starts to fail.

I make little investigation and found that if I turn off
django.contrib.admin everythings works correct. Also find that
probably the problem is admin.autodiscover() function.

Probably the error is:
"You need to register at least one template for Page before the admin
code is included."
But, with DEBUG=True, everything was fine. And on developer server (./
manage.py runserver) with both works fine.

Pawel

xyz69

unread,
Oct 1, 2009, 8:17:42 PM10/1/09
to Django FeinCMS
Maybe it would sounds funny, but I play with this problem almost a
week, and find a solution just now:)

Before: I have special app named "utils" included in INSTALLLED_APPS
(as suggested in docs) and in model.py was configured
feincms.module.page. The problem was, that django in DEBUG=False on
wsgi, probably process urls.py before loading models from
INSTALLED_APPS(?).

After: I remove utils from INSTALLED_APPS and add in urls.py:

from feintest.utils import models # add this line BEFORE autodiscover
()
admin.autodiscover()

And that's all :)
Maybe it will be helpfull for someone:)

Paweł
Reply all
Reply to author
Forward
0 new messages