Question

So, I'm studying Django, and when trying to show a index.html, I get this error:

ImportError at /
No module named core
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 1.6.2
Exception Type: ImportError
Exception Value:    
No module named core
Exception Location: /usr/local/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 40
Python Executable:  /usr/local/opt/python/bin/python2.7
Python Version: 2.7.6
Python Path:    
['/Users/witalobenicio/PycharmProjects/Teste',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-3.4.1-py2.7.egg',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.9-x86_64.egg',
 '/usr/local/lib/python2.7/site-packages/setuptools-3.4.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.9-x86_64.egg',
 '/Users/witalobenicio/PycharmProjects/Teste/$PYTHONPATH',
 '/Users/witalobenicio/PycharmProjects/Teste',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-packages',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 '/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/Library/Python/2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages']
Server time:    Mon, 5 May 2014 17:11:19 +0000
Was it helpful?

Solution

The problem was in urls.py.

I had this regular expression:

url(r'^$', 'Teste.core.views.home', name='home'),

but i have to use:

url(r'^$', 'core.views.home', name='home'),
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top