diff --git a/examples/djopenid/settings.py b/examples/djopenid/settings.py index 6d0fe0c2..f2a7c872 100644 --- a/examples/djopenid/settings.py +++ b/examples/djopenid/settings.py @@ -19,12 +19,16 @@ MANAGERS = ADMINS -DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. -DATABASE_NAME = '/tmp/test.db' # 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. +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': '/tmp/test.db', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} # Local time zone for this installation. All choices can be found here: # http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE @@ -55,8 +59,8 @@ # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.load_template_source', ) diff --git a/examples/djopenid/util.py b/examples/djopenid/util.py index 4f359e14..7b30df13 100644 --- a/examples/djopenid/util.py +++ b/examples/djopenid/util.py @@ -41,7 +41,7 @@ def getOpenIDStore(filestore_path, table_prefix): The result of this function should be passed to the Consumer constructor as the store parameter. """ - if not settings.DATABASE_ENGINE: + if not settings.DATABASES.get('default', {'ENGINE':None}).get('ENGINE'): return FileOpenIDStore(filestore_path) # Possible side-effect: create a database connection if one isn't @@ -55,18 +55,18 @@ def getOpenIDStore(filestore_path, table_prefix): } types = { - 'postgresql': sqlstore.PostgreSQLStore, - 'mysql': sqlstore.MySQLStore, - 'sqlite3': sqlstore.SQLiteStore, + 'django.db.backends.postgresql': sqlstore.PostgreSQLStore, + 'django.db.backends.mysql': sqlstore.MySQLStore, + 'django.db.backends.sqlite3': sqlstore.SQLiteStore, } try: - s = types[settings.DATABASE_ENGINE](connection.connection, + s = types[settings.DATABASES.get('default', {'ENGINE':None}).get('ENGINE')](connection.connection, **tablenames) except KeyError: raise ImproperlyConfigured, \ "Database engine %s not supported by OpenID library" % \ - (settings.DATABASE_ENGINE,) + (settings.DATABASES.get('default', {'ENGINE':None}).get('ENGINE'),) try: s.createTables()