[Django]-ImproperlyConfigured: The included urlconf <project>.urls doesn't have any patterns in it

150πŸ‘

βœ…

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.

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

14πŸ‘

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')

2πŸ‘

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?

0πŸ‘

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.

0πŸ‘

Also make sure you have urlpatterns in the file you are including and that it is spelt correctly

Leave a comment