snipt/settings.py

199 lines
5.3 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
import 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
2011-10-23 17:54:44 -07:00
DATABASES = {
'default': {
2012-02-14 18:09:39 -08:00
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'snipt',
2012-09-18 13:45:00 -07:00
'USER': '',
'PASSWORD': '',
2012-02-14 18:09:39 -08:00
'HOST': 'localhost',
2011-10-23 17:54:44 -07:00
'PORT': '',
}
}
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
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
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'
# 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
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
2011-10-23 19:44:37 -07:00
STATIC_ROOT = os.path.join(BASE_PATH, 'static')
STATIC_URL = '/static/'
2011-10-23 17:54:44 -07:00
# Additional locations of static files
STATICFILES_DIRS = (
2011-10-23 19:44:37 -07:00
os.path.join(BASE_PATH, 'media'),
2011-10-23 17:54:44 -07:00
)
2011-06-01 21:50:18 -07:00
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
2012-09-18 13:45:00 -07:00
SECRET_KEY = ''
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',
'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
)
2011-10-23 17:54:44 -07:00
ROOT_URLCONF = 'snipt.urls'
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,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
2012-10-21 10:03:22 -07:00
'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
LOGIN_REDIRECT_URL = '/'
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:
from local_settings import *
except ImportError:
pass