I am getting a import error in django. My main urls.py settings file is located at main/main/urls.py
my module or app is located here main/apps/builder/urls.py
.
traceback error
ImportError at /
No module named apps.builder.urls
Request Method: GET
Request URL: ***************
Django Version: 1.4
Exception Type: ImportError
Exception Value:
No module named apps.builder.urls
Exception Location: /usr/lib/python2.6/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python26
Python Version: 2.6.0
Python Path:
['/home/pycode/main',
'/usr/lib/python26.zip',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/lib/python2.6/site-packages']
Server time: Tue, 12 Jun 2012 12:39:17 -0500
main/main/urls.py
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^$', include('main.apps.builder.urls')),
)
Your apps
module must be below main/main
or you have to make sure your apps
folder is in your sys.path
, probably best to set PYTHONPATH.
Did you add it to INSTALLED_APPS
in your settings.py file?
https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
also as ramdaz suggested each directory needs a __init__.py
file even if it is empty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With