Django 1.8, Unable to run manage.py

564 views Asked by At

A newbie here. I am getting following erorr:

python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File "//anaconda/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "//anaconda/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "//anaconda/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "//anaconda/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "//anaconda/lib/python2.7/site-packages/app/models.py", line 61, in <module>
    }[connection.vendor]
KeyError: 'unknown'
3

There are 3 answers

0
Soviut On

If you look on the last line of the stack trace, you can see that you have an error in your models.py file on line 61.

connection.vendor, which you're using as a key, is 'unknown'. That key doesn't exist.

0
Klaus D. On

The error you are presenting is a result of an improperly configured database. Django does not know the type of database you are using and reports unknown which is not expected in the code

Please check your DATABASES configuration in your settings and make sure the right setting file is uses.

1
Mohammed Safeer On

Create and configure database before you migrate.

Please check your settings.py file

You may not have the correct DATABASES in your settings. There should be a database settings named 'default'