Support Django 1.4 database engine changes transparently #136

Closed
wants to merge 1 commit into
from

Projects

None yet

1 participant

@JustinVenus
Contributor

Minor change to support both Django Database Engine types transparently.

Allows < 1.4 and 1.4+ versions of Django to work without burdening the administrator.

@JustinVenus JustinVenus commented on the diff Jan 17, 2013
webapp/graphite/settings.py
-DATABASE_USER = '' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+if DJANGO_VERSION < (1,4):
+ #Initialize database settings - Old style (pre 1.2)
+ DATABASE_ENGINE = 'django.db.backends.sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
+ DATABASE_NAME = '' # Or path to database file if using sqlite3.
+ DATABASE_USER = '' # Not used with sqlite3.
+ DATABASE_PASSWORD = '' # Not used with sqlite3.
+ DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
+ DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+else:
+ DATABASES = {
+ 'default': {
+ 'NAME': '/opt/graphite/storage/graphite.db',
@JustinVenus
JustinVenus Jan 17, 2013 Contributor

this line should be
"'NAME': '',

@SEJeff SEJeff closed this in 1900a9c May 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment