instead of 'module' has no attribute 'urlpatterns', a more useful error message would be nice to have, as I just wasted 30 mins of time just to notice I forgot to append .urls in an include() in urlconf.
I've patched my django.core.urlresolvers with this:
Index: urlresolvers.py
===================================================================
--- urlresolvers.py (wersja 4270)
+++ urlresolvers.py (kopia robocza)
@@ -157,6 +157,8 @@
match = self.regex.search(path)
if match:
new_path = path[match.end():]
+ if not hasattr(self.urlconf_module, 'urlpatterns'):
+ raise AttributeError('urlpatterns in module %s not found, is the parent urlconf correct?'%self.urlconf_module.__name__)
for pattern in self.urlconf_module.urlpatterns:
try:
sub_match = pattern.resolve(new_path)