Skip to content

Commit a225b89

Browse files
committed
settings.py maps db path dynamically.
1 parent 1474e2c commit a225b89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
DEBUG = True
44
TEMPLATE_DEBUG = DEBUG
55

6+
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
7+
68
ADMINS = (
79
# ('Your Name', 'your_email@example.com'),
810
)
@@ -12,7 +14,7 @@
1214
DATABASES = {
1315
'default': {
1416
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
15-
'NAME': 'db', # Or path to database file if using sqlite3.
17+
'NAME': os.path.join(SITE_ROOT, 'db'), # Or path to database file if using sqlite3.
1618
'USER': '', # Not used with sqlite3.
1719
'PASSWORD': '', # Not used with sqlite3.
1820
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.

0 commit comments

Comments
 (0)