python - ImportError: no module named urls but ROOT_URLCONF is correct -
i've read through similar questions find on google/so, , people had issue root_urlconf being incorrect or missing init.py.
my project structure is
djangotut/ polls/ static/ templates/ __init__.py manage.py settings.py urls.py
my project called djangotut, , there's group level called user_myusername_xyz (my place of work has prefab code use project setup, , i've done many times without running problem).
i've tried
root_urlconf = 'user_myusername_xyz.djangotut.urls'
(this our projects' settings.py files default to)
root_urlconf = 'djangotut.urls'
and
root_urlconf = 'urls'
i importerror every time, , know it's line because exceptionvalue changes string used there. (ex: "no module named user_myusername_xyz.djangotut.urls").
the urls.py file there, why can't settings.py see it?
urls.py
from django.conf.urls import include, patterns, url django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^apps/username_myusername_xyz/djangotut/', include('djangotut.polls.urls')), url(r'^admin/', include('admin.site.urls')), )
the solution remove quotes 'admin.site.urls.' quotes still needed when including urls installed_app, reason admin 1 doesn't quotes.
Comments
Post a Comment