I have a django (1.6.x) project that runs fine with the dev server, but is failing under Apache2 (2.2.22.1) and mod_wsgi (3.3-4) on Ubuntu 12.04.3 with the error
Imp
I used reverse instead of reverse_lazy to define the url parameter of a RedirectView.
class YourRedirectView(RedirectView):
url = reverse('reversed_url')
Since the urls.py has not been initialized yet the error is coming up. Just use:
class YourRedirectView(RedirectView):
url = reverse_lazy('reversed_url')
Also make sure you have urlpatterns
in the file you are including and that it is spelt correctly
I've suffered a similar problem after upgrading from django 1.5 to 1.6. I'm not sure if my experience is the same as yours.
First, can you scroll up the errors, and check the admin.autodiscover()
is what's generating the problem? Alternatively comment out this line and see if a page will load.
The problem I found was related to wsgi.py
. Is it possible for you to post this file?
So, I actually ran into a similar problem. Coincidentally after you posted in the issues for django-stronghold. The issue is in fact due to a missing setting in django-debug-toolbar.
The setting you are missing is:
DEBUG_TOOLBAR_PATCH_SETTINGS = False
It will work with runserver, but if you try to run it with honcho, or gunicorn, or anything else that uses the WSGI interface it blows up.
Hope this helps!
EDIT: as mentioned below by @japhyr, its useful to check out the explicit setup instructions: http://django-debug-toolbar.readthedocs.org/en/1.0/installation.html#explicit-setup
I'm having a very similar problem. My project works fine on the test server, but when I try to deploy to gunicorn I get the same ImproperlyConfigured error.
If I comment out the urls which include another url file (i.e. url(r'^admin/', include(admin.site.urls)),
then the rest of my urls work fine.
[UPDATE] I was able to further narrow it down to only one of my included url files, but couldn't find anything special about it. However, setting Debug=False
in my settings.py
file seems to have fixed for me.