Created
June 15, 2013 02:11
-
-
Save tyaslab/5786503 to your computer and use it in GitHub Desktop.
more flexible django settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.conf import settings | |
PWD = os.path.dirname(os.path.dirname(__file__)) | |
### ... | |
DATABASES = { | |
### ... | |
'NAME': os.path.join(PWD, 'databasename.db'), # Or path to database file if using sqlite3. | |
### ... | |
} | |
### ... | |
MEDIA_ROOT = os.path.join(PWD, 'media') | |
### ... | |
STATIC_ROOT = os.path.join(PWD, 'static') | |
### ... | |
TEMPLATE_DIRS = ( | |
### ... | |
os.path.join(PWD, 'templates'), | |
) | |
### ... | |
INSTALLED_APPS = ( | |
'yourmainapp', # Your main app should be the first to enable overriding | |
# ... | |
) | |
# ... | |
TEMPLATE_CONTEXT_PROCESSORS = settings.TEMPLATE_CONTEXT_PROCESSORS + ( | |
'django.core.context_processors.request', | |
) | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment