error when trying to execute python manage.py migrate

  django, mysql, python-3.x

django.db.utils.OperationalError: (1046, ‘No database selected’)

I get the above error when I try to execute:

python manage.py migrate

The database settings in my settings.py file are:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'DATABASE': 'financeblog',
        'USER': 'financeblog',
        'PASSWORD': 'xxxxx',
        'HOST': '127.0.0.1',
        'PORT': '3308',
    }
}

I have confirmed that the database does in fact exist. The port is 3308

Source: Python-3x Questions

LEAVE A COMMENT