mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Streamlined settings. Removed test settings and moved defaults to settings.py
This commit is contained in:
parent
241180a350
commit
4aaa2973be
2 changed files with 20 additions and 27 deletions
|
@ -23,6 +23,8 @@ ALLOWED_HOSTS = (
|
|||
'www.dpaste.org',
|
||||
)
|
||||
|
||||
SECRET_KEY = 'CHANGE_ME'
|
||||
|
||||
#==============================================================================
|
||||
# I18N
|
||||
#==============================================================================
|
||||
|
@ -46,18 +48,16 @@ PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
|
|||
os.path.dirname(os.path.realpath(dpaste.__file__))
|
||||
)
|
||||
|
||||
|
||||
# Set the variable root to $VIRTUALENV/var.
|
||||
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/
|
||||
# directory means that we're running in a virtual environment. Set the
|
||||
# variable root to $VIRTUALENV/var.
|
||||
|
||||
if not os.path.exists(os.path.join(PYTHON_BIN, 'activate_this.py')):
|
||||
raise RuntimeError('Project needs to run in its own virtuelenv.')
|
||||
|
||||
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
|
||||
if not os.path.exists(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
|
||||
|
@ -105,6 +105,15 @@ INSTALLED_APPS = (
|
|||
'dpaste',
|
||||
)
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': 'dev.db',
|
||||
'USER': '',
|
||||
'PASSWORD': '',
|
||||
}
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# App specific settings
|
||||
#==============================================================================
|
||||
|
|
|
@ -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'
|
||||
|
Loading…
Reference in a new issue