no module in error log django-1.3.7

15 views
Skip to first unread message

Kakar Nyori

unread,
Oct 22, 2014, 9:27:35 AM10/22/14
to django...@googlegroups.com
Hello,
I am trying to run a python app in pythonanywhere.com. If I run the project through the bash it runs without any error. But when I see it in the browser with the name like myproject.pythonanywhere.com, it display "something went wrong".
And when I check in the error log, it show me this:

no module named appname.

What went wrong?

This is the path structure of the project:

projectname
------__init__.py
------manage.py
------settings.py
------urls.py
------appname
----------__init__.py
----------admin.py
----------forms.py
----------models.py
----------views.py
----------tests.py
------static
----------css
--------------style.css
----------js
--------------ui.js
------templates
----------index.html

Collin Anderson

unread,
Oct 23, 2014, 8:31:42 AM10/23/14
to django...@googlegroups.com
Hello,

I think you have 3 options:
1. Migrate to the new (django 1.5+) project layout like this:
projectname
------manage.py
------projectname
----------__init__.py
----------settings.py
----------urls.py
------appname
----------__init__.py
----------admin.py
----------forms.py
----------models.py
----------views.py
----------tests.py

2. Configure your python path to include both projectname directory, and the directory containing projectname

3. Reference everything using the projectname prefix:
'projectname.appname'  # INSTALLED_APPS
from projectname.appname.models import MyModel

Collin

Reply all
Reply to author
Forward
0 new messages