dpaste/pastebin/conf/settings.py

120 lines
3.8 KiB
Python
Raw Normal View History

2011-06-08 20:23:08 +10:00
# Import global settings to make it easier to extend settings.
2011-05-30 09:03:04 +10:00
from django.conf.global_settings import *
#==============================================================================
# Generic Django project settings
#==============================================================================
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
2012-04-16 00:54:26 +10:00
TIME_ZONE = 'UTC'
2011-05-30 09:03:04 +10:00
SITE_ID = 1
# Make this unique, and don't share it with anybody.
SECRET_KEY = ''
#==============================================================================
# I18N
#==============================================================================
2012-04-16 00:54:26 +10:00
USE_I18N = False
2011-06-08 20:23:08 +10:00
USE_L10N = False
2011-05-30 09:03:04 +10:00
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'English'),
)
#==============================================================================
# Calculation of directories relative to the module location
#==============================================================================
import os
import sys
import pastebin
PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
os.path.dirname(os.path.realpath(pastebin.__file__))
)
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')
#==============================================================================
# Static files
#==============================================================================
STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
#==============================================================================
# Project URLS and media settings
#==============================================================================
MEDIA_URL = '/uploads/'
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
MEDIA_ROOT = os.path.join(VAR_ROOT, 'uploads')
ROOT_URLCONF = 'pastebin.conf.urls'
LOGIN_URL = '/accounts/login/'
LOGOUT_URL = '/accounts/logout/'
LOGIN_REDIRECT_URL = '/'
#==============================================================================
# Templates
#==============================================================================
2011-05-30 17:01:45 +10:00
MIDDLEWARE_CLASSES = (
2011-06-09 04:48:23 +10:00
'pastebin.disable.DisableCSRF',
2011-05-30 17:01:45 +10:00
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
2011-06-10 22:25:56 +10:00
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
)
2011-05-30 09:03:04 +10:00
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, PROJECT_MODULE_NAME, 'templates'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
2011-06-08 19:23:39 +10:00
'django.contrib.admin',
2011-05-30 09:03:04 +10:00
'mptt',
'south',
2011-05-30 09:03:04 +10:00
'pastebin',
'pastebin.apps.dpaste',
2011-05-30 09:51:01 +10:00
'gunicorn',
2012-06-16 07:57:52 +10:00
'raven.contrib.django',
2011-05-30 09:03:04 +10:00
)
#==============================================================================
# App specific settings
#==============================================================================
# How many recent snippets to save for every user? IDs of this snippets are
# stored in the user session.
MAX_SNIPPETS_PER_USER = 25
2012-06-16 07:57:52 +10:00
2012-06-16 20:32:49 +10:00
SENTRY_DSN = 'http://0afbf6df0a9749f9985059ed6c527b19:717d9800ba854149a7e7f6a501b2caa0@ohnoez.mahner.org/2'