Files
Pinry/pinry/settings/__init__.py

98 lines
2.8 KiB
Python
Raw Normal View History

2012-04-26 03:44:16 +00:00
import os
from collections import namedtuple
2012-05-01 05:44:50 +00:00
from django.contrib.messages import constants as messages
2012-04-26 03:44:16 +00:00
2012-08-01 21:30:18 +00:00
SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../')
# Changes the naming on the front-end of the website.
2012-07-25 01:58:40 +00:00
SITE_NAME = 'Pinry'
2012-08-01 21:30:18 +00:00
# Set to False to disable people from creating new accounts.
ALLOW_NEW_REGISTRATIONS = True
2012-07-25 01:58:40 +00:00
2012-08-01 21:30:18 +00:00
# Set to False to force users to login before seeing any pins.
PUBLIC = True
2012-04-26 03:44:16 +00:00
TIME_ZONE = 'America/New_York'
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
USE_TZ = True
2012-04-26 03:44:16 +00:00
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
MEDIA_ROOT = os.path.join(SITE_ROOT, 'media')
STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
TEMPLATE_DIRS = [os.path.join(SITE_ROOT, 'pinry/templates')]
STATICFILES_DIRS = [os.path.join(SITE_ROOT, 'pinry/static')]
2012-04-26 03:44:16 +00:00
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
2012-04-26 03:44:16 +00:00
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
2012-08-01 21:30:18 +00:00
'pinry.core.middleware.Public',
2012-04-26 03:44:16 +00:00
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
'pinry.core.context_processors.template_settings',
)
AUTHENTICATION_BACKENDS = (
'pinry.core.auth.backends.CombinedAuthBackend',
'django.contrib.auth.backends.ModelBackend',
2012-04-26 03:44:16 +00:00
)
COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
2012-04-26 03:44:16 +00:00
ROOT_URLCONF = 'pinry.urls'
LOGIN_REDIRECT_URL = '/'
INTERNAL_IPS = ['127.0.0.1']
2012-05-01 05:44:50 +00:00
MESSAGE_TAGS = {
messages.WARNING: 'alert',
messages.ERROR: 'alert alert-error',
messages.SUCCESS: 'alert alert-success',
messages.INFO: 'alert alert-info',
}
2012-09-29 19:42:16 +00:00
API_LIMIT_PER_PAGE = 30
2012-04-26 03:44:16 +00:00
2012-04-26 03:44:16 +00:00
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'south',
'compressor',
2012-09-28 04:42:13 +00:00
'taggit',
2012-04-26 03:44:16 +00:00
'pinry.core',
'pinry.pins',
'pinry.api',
2012-04-26 03:44:16 +00:00
)
AUTHENTICATION_BACKENDS = ('pinry.core.auth.backends.CombinedAuthBackend', 'django.contrib.auth.backends.ModelBackend',)
Dimensions = namedtuple("Dimensions", ['width', 'height'])
IMAGE_SIZES = {'thumbnail': Dimensions(width=240, height=0), 'standard': Dimensions(width=600, height=0)}