Trying to deploy local Django project on Python Anywhere, but receiving an ImportError: No module named 'models' when running "python manage.py createsuperuser"
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 341, in
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 341, in
execute
django.setup()
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/contrib/admin/apps.py", line 23, in ready
self.module.autodiscover()
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/contrib/admin/__init__.py", line 26, in au
todiscover
autodiscover_modules('admin', register_to=site)
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/site-packages/django/utils/module_loading.py", line 50, in auto
discover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/myvenv/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/Ananthu/MCQ-app-mutile-choice-question-app-/quiz/admin.py", line 2, in <module>
from models import Question,Result
ImportError: No module named 'models'
This is the tree result
|--manage.py
|── qsystem
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ └── settings.cpython-35.pyc
│ ├── settings.py
│ ├── settings.pyc
│ ├── urls.py
│ ├── urls.pyc
│ ├── wsgi.py
│ └── wsgi.pyc
└── quiz
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-35.pyc
│ ├── admin.cpython-35.pyc
│ └── models.cpython-35.pyc
├── admin.py
├── apps.py
├── forms.py
├── models.py
├── static
│ └── css
│ └── style.css
How can I solve this? Thankyou
Try:
from quiz.models import Question,Result