diff --git a/dpaste/settings.py b/dpaste/settings.py index 4f1b189..bd8fa56 100644 --- a/dpaste/settings.py +++ b/dpaste/settings.py @@ -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. - 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') + +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) #============================================================================== # Static files @@ -105,6 +105,15 @@ INSTALLED_APPS = ( 'dpaste', ) +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'dev.db', + 'USER': '', + 'PASSWORD': '', + } +} + #============================================================================== # App specific settings #============================================================================== diff --git a/dpaste/settings_test.py b/dpaste/settings_test.py deleted file mode 100644 index cbda395..0000000 --- a/dpaste/settings_test.py +++ /dev/null @@ -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' -