django - Why can't python find my module? -
i'm getting error every time type python manage.py runserver in root server of django app.
importerror: no module named utils
i added new app project called 'utils' running python manage.py startapp utils in root directory of project (/ecomstore/), , moved directory book said put in.
here's overview of project's directories, followed code:
ecomstore/
init.py
manage.py
settings.py
urls.py
views.py
wsgi.py
catalog.py/
init.py
admin.py
forms.py
models.py
tests.py
urls.py
views.py
static.py/
catalog.css
catalog.html
css.css
templates/
base.html
catalog/
catalog.html
index.html
tags/
utils/
init.py
models.py
tests.py
views.py
context_processors.py
the relevent code settings.py file below:
installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'catalog', 'utils', # uncomment next line enable admin: 'django.contrib.admin', # uncomment next line enable admin documentation: # 'django.contrib.admindocs', )
fwiw: have tried putting 'ecomstore.utils' under installed_apps, , moving utils directory root directory of project. book called beginning django ecommerce , it's outdated. in advance help, i'm stuck!
- utils should moved 1 level up, "templates" "ecomstore".
- the init files should named
__init__.py
, notinit.py
. - it unusual have .py-endings directories
i suggest teh django tutorial first if book outdated , after succeed this, try adapt book content learned in tutorial.
Comments
Post a Comment