snipt/settings.py

199 lines
5.2 KiB
Python
Raw Normal View History

2012-09-18 13:45:00 -07:00
# Django settings for snipt project.
2011-06-01 21:50:18 -07:00
2014-10-20 08:13:02 -07:00
import dj_database_url, os
2011-10-23 17:54:44 -07:00
DEBUG = True
2011-10-23 19:44:37 -07:00
BASE_PATH = os.path.dirname(__file__)
2011-06-01 21:50:18 -07:00
ADMINS = (
2012-09-18 13:45:00 -07:00
('Name', 'name@domain.com'),
2011-06-01 21:50:18 -07:00
)
MANAGERS = ADMINS
2011-06-01 21:50:18 -07:00
2014-10-20 08:13:02 -07:00
DATABASES['default'] = dj_database_url.config()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'media'),
os.path.join(BASE_DIR, 'static'),
)
2011-10-23 17:54:44 -07:00
INTERNAL_IPS = ('127.0.0.1',)
2011-10-23 17:54:44 -07:00
2011-06-01 21:50:18 -07:00
SITE_ID = 1
2011-10-23 17:54:44 -07:00
USE_I18N = True
2011-06-01 21:50:18 -07:00
2011-10-23 17:54:44 -07:00
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Local time zone. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
#
# On Unix systems, a value of None will cause Django to use the same timezone as
# the operating system. On a Windows environment, this must be set to the same
# as your system time zone
TIME_ZONE = 'America/New_York'
USE_TZ = True
# Language code for the Django installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
2011-10-23 17:54:44 -07:00
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
2011-12-25 13:00:41 -08:00
MEDIA_ROOT = os.path.join(BASE_PATH, 'media/uploads')
2011-10-23 17:54:44 -07:00
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
2011-12-25 13:00:41 -08:00
MEDIA_URL = '/media/uploads/'
2011-10-23 17:54:44 -07:00
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
2011-06-01 21:50:18 -07:00
)
2011-10-23 17:54:44 -07:00
2013-04-14 20:35:05 -07:00
SECRET_KEY = 'changethis'
2011-10-23 17:54:44 -07:00
INSTALLED_APPS = (
'gunicorn',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django_bcrypt',
'haystack',
'markdown_deux',
'pagination',
'postmark',
'registration',
'south',
'taggit',
'tastypie',
'typogrify',
'accounts',
'blogs',
2013-09-05 10:28:35 -07:00
'jobs',
'snipts',
'utils',
)
2011-10-23 17:54:44 -07:00
# List of callables that know how to import templates from various sources.
2011-06-01 21:50:18 -07:00
TEMPLATE_LOADERS = (
2011-10-23 17:54:44 -07:00
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
2011-06-01 21:50:18 -07:00
)
2011-10-23 19:44:37 -07:00
TEMPLATE_CONTEXT_PROCESSORS = (
2012-06-04 13:22:00 -07:00
'django.contrib.auth.context_processors.auth',
2011-10-23 19:44:37 -07:00
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages',
2011-10-23 19:44:37 -07:00
)
2011-10-23 17:54:44 -07:00
2011-06-01 21:50:18 -07:00
MIDDLEWARE_CLASSES = (
2012-06-04 13:22:00 -07:00
'django.middleware.csrf.CsrfViewMiddleware',
2011-06-01 21:50:18 -07:00
'django.middleware.common.CommonMiddleware',
2011-10-23 17:54:44 -07:00
'django.contrib.sessions.middleware.SessionMiddleware',
2011-06-01 21:50:18 -07:00
'django.contrib.auth.middleware.AuthenticationMiddleware',
2011-10-23 17:54:44 -07:00
'django.contrib.messages.middleware.MessageMiddleware',
2011-10-12 08:29:21 -07:00
'pagination.middleware.PaginationMiddleware',
2012-06-04 14:09:08 -07:00
'blogs.middleware.BlogMiddleware',
2011-06-01 21:50:18 -07:00
)
AUTHENTICATION_BACKENDS = (
'utils.backends.EmailOrUsernameModelBackend',
)
ROOT_URLCONF = 'urls'
2011-10-23 17:54:44 -07:00
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
2011-06-01 21:50:18 -07:00
2011-10-23 17:54:44 -07:00
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates')
)
2011-06-01 21:50:18 -07:00
2013-01-30 07:32:13 -08:00
SESSION_COOKIE_AGE = 15801100
2011-10-23 17:54:44 -07:00
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
2011-10-23 17:54:44 -07:00
'handlers': {
#'mail_admins': {
#'level': 'ERROR',
#'filters': ['require_debug_false'],
#'class': 'django.utils.log.AdminEmailHandler'
#}
2011-10-23 17:54:44 -07:00
},
'loggers': {
#'django.request': {
#'handlers': ['mail_admins'],
#'level': 'ERROR',
#'propagate': True,
#},
2011-10-23 17:54:44 -07:00
}
}
2011-06-01 21:50:18 -07:00
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
},
}
2013-01-20 10:42:18 -08:00
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
2011-10-23 17:54:44 -07:00
# Account settings
2013-04-28 17:11:11 -07:00
LOGIN_REDIRECT_URL = '/login-redirect/'
2011-10-23 17:54:44 -07:00
LOGIN_URL = '/login/'
LOGOUT_URL = '/logout/'
2012-02-12 21:42:25 -08:00
ACCOUNT_ACTIVATION_DAYS = 0
2011-10-23 17:54:44 -07:00
2012-05-15 17:10:50 -07:00
# Messages
MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
2011-10-02 15:38:20 -07:00
# User absolute URLs
ABSOLUTE_URL_OVERRIDES = {
'auth.user': lambda u: "/%s/" % u.username,
}
2011-10-24 20:34:07 -07:00
2012-06-26 08:33:22 -07:00
# Accounts
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
2012-09-14 06:47:16 -07:00
# API
TASTYPIE_CANNED_ERROR = "There was an error with your request. The site developers have a record of this error, please email api@snipt.net and we'll help you out."
2012-09-18 13:45:00 -07:00
try:
2013-03-25 17:45:27 -07:00
from settings_local import *
2012-09-18 13:45:00 -07:00
except ImportError:
pass