Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImproperlyConfigured: The included urlconf <app>.urls doesn't have any patterns in it #30

Closed
lachlansimpson opened this issue Jan 7, 2014 · 4 comments

Comments

@lachlansimpson
Copy link

Hola, I'm getting the above as an error. I've fleshed out the relative conf and py files on SO: http://stackoverflow.com/questions/20963856/improperlyconfigured-the-included-urlconf-project-urls-doesnt-have-any-patte

From the Apache2 error log, it looks like it's got something to do with Stronghold?

I tried deleting /.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/conf.pyc and then replaced reverse with reverse_lazy in conf.py but that didn't work.

Any idea what might be going wrong?

 mod_wsgi (pid=25007): Exception occurred processing WSGI script '/home/erp/www/dev/erp/erp/erp/wsgi.py'.
 Traceback (most recent call last):
  File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
     self.load_middleware()
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
     mw_class = import_by_path(middleware_path)
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/utils/module_loading.py", line 21, in import_by_path
     module = import_module(module_path)
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
     __import__(name)
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/middleware.py", line 2, in <module>
     from stronghold import conf, utils
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/conf.py", line 33, in <module>
     url = reverse(named_url)
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 509, in reverse
     return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 387, in _reverse_with_prefix
     possibilities = self.reverse_dict.getlist(lookup_view)
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 296, in reverse_dict
     self._populate()
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 262, in _populate
     for pattern in reversed(self.url_patterns):
   File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 350, in url_patterns
     raise ImproperlyConfigured("The included urlconf %s doesn't have any patterns in it" % self.urlconf_name)
ImproperlyConfigured: The included urlconf erp.urls doesn't have any patterns in it
@mgrouchy
Copy link
Owner

mgrouchy commented Jan 7, 2014

So this is not a stronghold problem. This is a broken urlconf problem. I'm not at a computer but from a quick look at your stackoverflow question I suggest maybe adding erp to installed_apps (before stronghold).

Like I said I will take a better look when I'm at a computer but in the meantime give that a try.

On Jan 6, 2014, at 11:50 PM, Lachlan Musicman notifications@github.com wrote:

Hola, I'm getting the above as an error. I've fleshed out the relative conf and py files on SO: http://stackoverflow.com/questions/20963856/improperlyconfigured-the-included-urlconf-project-urls-doesnt-have-any-patte

From the Apache2 error log, it looks like it's got something to do with Stronghold?

I tried deleting /.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/conf.pyc and then replaced reverse with reverse_lazy in conf.py but that didn't work.

Any idea what might be going wrong?

mod_wsgi (pid=25007): Exception occurred processing WSGI script '/home/erp/www/dev/erp/erp/erp/wsgi.py'.
Traceback (most recent call last):
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in call
self.load_middleware()
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
mw_class = import_by_path(middleware_path)
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/utils/module_loading.py", line 21, in import_by_path
module = import_module(module_path)
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/middleware.py", line 2, in
from stronghold import conf, utils
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/stronghold/conf.py", line 33, in
url = reverse(named_url)
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 509, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, _args, *_kwargs))
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 387, in _reverse_with_prefix
possibilities = self.reverse_dict.getlist(lookup_view)
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 296, in reverse_dict
self._populate()
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 262, in _populate
for pattern in reversed(self.url_patterns):
File "/home/erp/.virtualenvs/erp-dev/lib/python2.7/site-packages/django/core/urlresolvers.py", line 350, in url_patterns
raise ImproperlyConfigured("The included urlconf %s doesn't have any patterns in it" % self.urlconf_name)
ImproperlyConfigured: The included urlconf erp.urls doesn't have any patterns in it

Reply to this email directly or view it on GitHub.

@mgrouchy
Copy link
Owner

mgrouchy commented Jan 7, 2014

So I looked at your setup again, and looked at the two scoops sample project(https://github.com/twoscoops/django-twoscoops-project). I think the missing addition of erp to your installed apps is the problem. Its likely the devserver puts it on path but mod_wsgi does not. If you look at the two scoops sample project in the base settings they explicitly add the directory to path so when you specify 'erp.urls' it knows what it is looking for.

Try that and let me know if it still fails.

@mgrouchy
Copy link
Owner

mgrouchy commented Jan 9, 2014

Well, looks like this turned out to be a problem in the Django Debug Toolbar configuration. Closing this.

@mgrouchy mgrouchy closed this as completed Jan 9, 2014
@ebisinteidennis
Copy link

Hello, i just tried this your code and it still fails. Pls how an i get it resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants