1

EDIT I'm receiving this error when migrating:

raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

My DATABASE config for settings.py is like so:

DATABASES = { 
  'default': {},
  'db1': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'metrix1',
    'USER': 'appserver',
    'PASSWORD': '***',
    'HOST': 'localhost',
    'PORT': '2323',
  },  
  'db2': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'metrix2',
    'USER': 'appserver',
    'PASSWORD': '***',
    'HOST': 'localhost',
    'PORT': '2324',
  },  
}

Any help would be great! Thanks.

EDIT THIS PART FIXED there was a typo with the user credentials.

Also getting this error--not sure if it's related to the settings.DATABASES error I'm receiving:

OperationalError at /counters_app/
(1045, "Access denied for user 'appserver'@'localhost' (using password: YES)")
Request Method: POST
Request URL:    http://127.0.0.1:8000/counters_app/
Django Version: 1.9
Exception Type: OperationalError
Exception Value:    
(1045, "Access denied for user 'appserver'@'localhost' (using password: YES)")
Exception Location: /usr/local/lib/python2.7/site-packages/MySQLdb/connections.py in __init__, line 204
Python Executable:  /usr/local/opt/python/bin/python2.7
Python Version: 2.7.10
Python Path:    
5
  • That does not explain the error. Is there addional code that says which DB Ro use? Maybe using an environmental variable? Commented Dec 21, 2015 at 6:31
  • What are you attempting to run and how? Commented Dec 21, 2015 at 6:34
  • @alexanderlukanin13 I'm attempting to run a basic counters Django app on aws instance and trying to access its index page locally. Commented Dec 21, 2015 at 6:41
  • @KlausD. Sorry, could you clarify your question? I thought that the error was coming from improper database setting in settings.py Commented Dec 21, 2015 at 6:43
  • 1
    Your second error shows your user doesn't have permissions on your db (or wrong credentials). Commented Dec 21, 2015 at 7:21

1 Answer 1

1

You must configure 'default' database, according to settings documentation.

Sign up to request clarification or add additional context in comments.

2 Comments

omg no you were completely right! I thought I could leave it empty, but I guess I needed to configure it!! thank you!
I do believe that alexanderlukanin13 is probably right, certainly the settings docs say that, but take a look at this, the second code snippet down from the top. I tried that, but I'm getting the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.