-DATABASES = {
- 'default': {
- 'ENGINE' : 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME' : os.path.join(DATAROOT,'unfold.sqlite3'), # 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.
+if config.database.engine :
+ DATABASES = {
+ 'default': {
+ 'ENGINE' : 'django.db.backends.%s' % config.database.engine,
+ 'USER' : config.database.user or '',
+ 'PASSWORD' : config.database.password or '',
+ 'HOST' : config.database.host or '',
+ 'PORT' : config.database.port or '',
+ }
+ }
+ if config.database.engine == 'sqlite3' :
+ DATABASES['default']['NAME'] = os.path.join(DATAROOT,'%s.sqlite3' % config.database.name)
+ else :
+ DATABASES['default']['NAME'] = config.database.name
+else :
+ # default database is sqlite
+ DATABASES = {
+ 'default': {
+ 'ENGINE' : 'django.db.backends.sqlite3',
+ 'NAME' : os.path.join(DATAROOT,'myslice.sqlite3'),
+ 'USER' : '',
+ 'PASSWORD' : '',
+ 'HOST' : '',
+ 'PORT' : '',
+ }