0

I just started up with django, after creating the models. I created a project poll. for the database migration.

      python manage.py makemigrations polls

It throws error :-

ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named mysite.settings

Here is how manage.py looks :-

#!/usr/bin/env python
import os
import sys

    if __name__ == "__main__":
        os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

        from django.core.management import execute_from_command_line

        execute_from_command_line(sys.argv)

Here is how the directory structure looks :-

  .
|-- db.sqlite3
|-- __init__.py
|-- __init__.pyc
|-- manage.py
|-- polls
|   |-- admin.py
|   |-- admin.pyc
|   |-- __init__.py
|   |-- __init__.pyc
|   |-- migrations
|   |   `-- __init__.py
|   |-- models.py
|   |-- models.pyc
|   |-- tests.py
|   |-- tests.pyc
|   |-- views.py
|   `-- views.pyc
|-- settings.py
|-- settings.pyc
|-- urls.py
|-- urls.pyc
|-- wsgi.py
`-- wsgi.pyc
user2475624
  • 311
  • 2
  • 5
  • 24

0 Answers0