Streamlined settings. Removed test settings and moved defaults to settings.py

This commit is contained in:
Martin Mahner 2013-03-29 19:25:27 +01:00
parent 241180a350
commit 4aaa2973be
2 changed files with 20 additions and 27 deletions

View file

@ -23,6 +23,8 @@ ALLOWED_HOSTS = (
'www.dpaste.org', 'www.dpaste.org',
) )
SECRET_KEY = 'CHANGE_ME'
#============================================================================== #==============================================================================
# I18N # I18N
#============================================================================== #==============================================================================
@ -46,18 +48,16 @@ PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
os.path.dirname(os.path.realpath(dpaste.__file__)) os.path.dirname(os.path.realpath(dpaste.__file__))
) )
# Set the variable root to $VIRTUALENV/var.
PYTHON_BIN = os.path.dirname(sys.executable) PYTHON_BIN = os.path.dirname(sys.executable)
if os.path.exists(os.path.join(PYTHON_BIN, 'activate_this.py')):
# Assume that the presence of 'activate_this.py' in the python bin/ if not os.path.exists(os.path.join(PYTHON_BIN, 'activate_this.py')):
# directory means that we're running in a virtual environment. Set the raise RuntimeError('Project needs to run in its own virtuelenv.')
# variable root to $VIRTUALENV/var.
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var') VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
if not os.path.exists(VAR_ROOT): if not os.path.exists(VAR_ROOT):
os.mkdir(VAR_ROOT) os.mkdir(VAR_ROOT)
else:
# Set the variable root to the local configuration location (which is
# ignored by the repository).
VAR_ROOT = os.path.join(PROJECT_DIR, PROJECT_MODULE_NAME, 'conf', 'local')
#============================================================================== #==============================================================================
# Static files # Static files
@ -105,6 +105,15 @@ INSTALLED_APPS = (
'dpaste', 'dpaste',
) )
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dev.db',
'USER': '',
'PASSWORD': '',
}
}
#============================================================================== #==============================================================================
# App specific settings # App specific settings
#============================================================================== #==============================================================================

View file

@ -1,16 +0,0 @@
from dpaste.settings import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dev.db',
'USER': '',
'PASSWORD': '',
}
}
SECRET_KEY = 'TESTING_TESTING'