Forums

MySQL settings on Custom Django settings

Hi!

I am using a custom version of Django, by using a virtual environment. Now, the problem is that whenever I try to connect to my database, I get issues.

The main issue being this: :::python django.core.exceptions.ImproperlyConfigured

Now, I configured everything correctly, I made sure that my username and password was all correct. Here is the snapshot, of my settings:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
    'NAME': 'gamesbrainiac$default',                      # Or path to database file if using sqlite3.
    # The following settings are not used with sqlite3:
    'USER': 'gamesbrainiac',
    'PASSWORD': '**********',
    'HOST': 'mysql.server',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
    'PORT': '',                      # Set to empty string for default.
}
}

That all looks correct.. is there any more info in the exception?

@Harry: Well when I try it says that it cannot find MySQLdb module. I tried installing it, but I cannot seem to install it with PIP.

aha. mysqldb requires compilation, so you can't install it yourself. If you start a new virtualenv using the --system-site-packages option, it'll give you access to our version of mysqld. You'll still be able to install your own, upgraded version of django which will supersede the system one...

@harry. Ok, will give it a shot.