'Django: ImportError, No module named urls
I have the following urls.py
file in my project directory:
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('wb.views',
url(r'^areas/$', 'arealist'),
url(r'^areas/(?P<area_id>\d+)/$', 'area_roomlist'),
url(r'^areas/(?P<area_id>\d+)/rooms/(?P<room_id>\d+)/$', 'area_roomdetail'),
url(r'^areas/add_area/$','add_area'),
url(r'^areas/area_added/$', 'area_added'),
url(r'^rooms/$', 'roomlist'),
url(r'^rooms/(?P<room_id>\d+)/$', 'roomdetail'),
url(r'^rooms/add_room/$', 'add_room'),
url(r'^rooms/room_added/$', 'room_added'),
url(r'^room_exits/$', 'room_exit_list'),
url(r'^room_exits/add_room_exit/$', 'add_room_exit'),
url(r'^room_exits/room_exit_added/$', 'room_exit_added'),
)
urlpatterns += patterns('',
url(r'^admin/', include(admin.site.urls)),
)
Whenever I try and load a page, I get following error:
ImportError at /page/, No module named urls
Anyone know what's going on? Thanks in advance.
Solution 1:[1]
ROOT_URLCONF was set to the wrong urls.py path in settings.py. Sorry!
Solution 2:[2]
Ensure your urls.py
in the app is spelt with the 's'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Voltemand11 |
Solution 2 | Samuel Tosan Ayo |