[billreminder] Provide default configuration and use sqlite3 as the default db engine



commit 3bc1cffd19d16a7515ac8aa8b2712ac2e2226859
Author: Og B. Maciel <ogmaciel gnome org>
Date:   Fri Jul 24 00:02:44 2009 -0400

    Provide default configuration and use sqlite3 as the default db engine

 src/settings.py |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/settings.py b/src/settings.py
index 67eff34..3543de6 100644
--- a/src/settings.py
+++ b/src/settings.py
@@ -1,5 +1,16 @@
 # Django settings for BillReminder project.
 
+import os
+from xdg.BaseDirectory import *
+
+try:
+    from billreminder.lib.common import APPNAME
+except Exception, e:
+    print str(e)
+    APPNAME = "BillReminder"
+
+DBFILE = os.path.join(xdg_data_home, APPNAME.lower(), "bills.db")
+
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
@@ -9,8 +20,8 @@ ADMINS = (
 
 MANAGERS = ADMINS
 
-DATABASE_ENGINE = ''           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = ''             # Or path to database file if using sqlite3.
+DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = DBFILE             # 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.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]