2014-03-18 12:48:12 +00:00
|
|
|
"""
|
|
|
|
Django settings for shelfzilla project.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/1.6/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/1.6/ref/settings/
|
|
|
|
"""
|
|
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
import os
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
|
|
|
|
2014-04-02 15:07:57 +00:00
|
|
|
_ = lambda x: x
|
|
|
|
|
2014-03-18 12:48:12 +00:00
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
2014-03-18 15:23:22 +00:00
|
|
|
SECRET_KEY = '0123456789'
|
2014-03-18 12:48:12 +00:00
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
TEMPLATE_DEBUG = True
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
2014-11-04 22:36:19 +00:00
|
|
|
# Auth
|
|
|
|
'django.contrib.auth',
|
2014-11-08 11:55:05 +00:00
|
|
|
'shelfzilla.apps.account',
|
2014-11-04 22:36:19 +00:00
|
|
|
|
2014-03-18 15:23:22 +00:00
|
|
|
# Admin
|
2014-03-18 12:48:12 +00:00
|
|
|
'suit',
|
|
|
|
'django.contrib.admin',
|
2014-04-24 15:11:16 +00:00
|
|
|
'solo',
|
2014-03-18 15:23:22 +00:00
|
|
|
|
|
|
|
# Django
|
2014-03-18 12:48:12 +00:00
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
|
2014-03-28 16:50:52 +00:00
|
|
|
# Files
|
|
|
|
"filer",
|
|
|
|
"mptt",
|
|
|
|
"easy_thumbnails",
|
|
|
|
|
2014-03-18 15:23:22 +00:00
|
|
|
# DDBB
|
2014-03-18 15:54:01 +00:00
|
|
|
'reversion',
|
2014-11-04 21:41:03 +00:00
|
|
|
# 'south',
|
2014-05-19 21:13:08 +00:00
|
|
|
'import_export',
|
2014-03-18 15:54:01 +00:00
|
|
|
|
2014-08-25 15:05:24 +00:00
|
|
|
# Staticfiles
|
|
|
|
"compressor",
|
2014-09-14 19:13:31 +00:00
|
|
|
'ckeditor',
|
2014-08-25 15:05:24 +00:00
|
|
|
|
2014-03-18 15:54:01 +00:00
|
|
|
# Apps
|
2014-04-25 10:47:26 +00:00
|
|
|
'shelfzilla.apps._admin',
|
2014-04-24 15:11:16 +00:00
|
|
|
'shelfzilla.apps.config',
|
2014-03-28 12:30:35 +00:00
|
|
|
'shelfzilla.apps.homepage',
|
2015-01-26 13:35:21 +00:00
|
|
|
# 'shelfzilla.apps.landing',
|
|
|
|
'shelfzilla.apps.mailing',
|
2014-03-18 15:54:01 +00:00
|
|
|
'shelfzilla.apps.manga',
|
2014-09-14 19:13:31 +00:00
|
|
|
'shelfzilla.apps.blog',
|
2014-04-03 16:53:37 +00:00
|
|
|
'shelfzilla.apps.pjax',
|
2015-03-31 05:53:16 +00:00
|
|
|
|
|
|
|
# API
|
|
|
|
'corsheaders',
|
|
|
|
'rest_framework',
|
|
|
|
'rest_framework.authtoken',
|
|
|
|
'djoser',
|
2014-03-18 12:48:12 +00:00
|
|
|
)
|
|
|
|
|
2014-03-18 15:23:22 +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.tz',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
'django.core.context_processors.request',
|
2014-03-31 13:32:50 +00:00
|
|
|
|
2014-04-03 16:53:37 +00:00
|
|
|
'shelfzilla.apps.pjax.context_processors.pjax',
|
2014-03-31 16:26:03 +00:00
|
|
|
'shelfzilla.apps.manga.context_processors.user_have_volumes',
|
|
|
|
'shelfzilla.apps.manga.context_processors.user_wishlisted_volumes',
|
2014-09-08 15:50:03 +00:00
|
|
|
'shelfzilla.apps.manga.context_processors.user_read_volumes',
|
2014-11-04 22:01:44 +00:00
|
|
|
'shelfzilla.apps.account.context_processors.auth',
|
|
|
|
'shelfzilla.apps.account.context_processors.user_is_staff',
|
|
|
|
# 'shelfzilla.apps.account.context_processors.user_configuration',
|
2014-03-18 15:23:22 +00:00
|
|
|
)
|
|
|
|
|
2014-03-18 12:48:12 +00:00
|
|
|
MIDDLEWARE_CLASSES = (
|
2014-03-18 15:54:01 +00:00
|
|
|
'reversion.middleware.RevisionMiddleware',
|
2014-03-18 12:48:12 +00:00
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2015-03-31 05:53:16 +00:00
|
|
|
'corsheaders.middleware.CorsMiddleware',
|
2014-03-18 12:48:12 +00:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
2014-04-02 15:07:57 +00:00
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
2014-03-18 12:48:12 +00:00
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
2014-03-18 17:23:12 +00:00
|
|
|
|
2014-11-04 22:36:19 +00:00
|
|
|
# 'shelfzilla.middleware.BetaMiddleware',
|
2014-03-18 12:48:12 +00:00
|
|
|
)
|
|
|
|
|
2014-03-18 15:23:22 +00:00
|
|
|
TEMPLATE_DIRS = (
|
|
|
|
os.path.join(BASE_DIR, "themes", "_base"),
|
2014-03-18 17:23:12 +00:00
|
|
|
os.path.join(BASE_DIR, "themes", "bootflat", "templates"),
|
2014-03-18 15:23:22 +00:00
|
|
|
)
|
|
|
|
|
2014-03-18 12:48:12 +00:00
|
|
|
ROOT_URLCONF = 'shelfzilla.urls'
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'shelfzilla.wsgi.application'
|
|
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.6/topics/i18n/
|
|
|
|
|
2014-04-02 15:07:57 +00:00
|
|
|
LANGUAGES = (
|
|
|
|
('es', _('Spanish')),
|
|
|
|
)
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'es'
|
|
|
|
|
|
|
|
LOCALE_PATHS = (
|
|
|
|
os.path.join(BASE_DIR, 'locale'),
|
|
|
|
)
|
2014-03-18 12:48:12 +00:00
|
|
|
|
2014-03-18 15:23:22 +00:00
|
|
|
TIME_ZONE = 'Europe/Madrid'
|
2014-03-18 12:48:12 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.6/howto/static-files/
|
|
|
|
|
2014-03-19 10:55:34 +00:00
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
|
|
|
STATIC_URL = "/static/"
|
|
|
|
|
2014-03-28 16:50:52 +00:00
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
2014-03-19 10:55:34 +00:00
|
|
|
# Additional locations of static files
|
|
|
|
STATICFILES_DIRS = (
|
|
|
|
os.path.join(BASE_DIR, "themes", "bootflat", "static"),
|
|
|
|
)
|
2014-03-18 15:23:22 +00:00
|
|
|
|
2014-08-25 15:05:24 +00:00
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
|
'compressor.finders.CompressorFinder',
|
|
|
|
)
|
|
|
|
|
|
|
|
COMPRESS_PRECOMPILERS = (
|
|
|
|
('text/less', 'lessc {infile} {outfile}'),
|
|
|
|
('text/coffeescript', 'coffee --compile --stdio --no-header'),
|
|
|
|
)
|
|
|
|
|
2014-03-18 15:23:22 +00:00
|
|
|
# Max username length (longerusername)
|
|
|
|
MAX_USERNAME_LENGTH = 75
|
2014-03-18 17:23:12 +00:00
|
|
|
|
|
|
|
# Beta settings
|
2014-11-04 22:36:19 +00:00
|
|
|
# BETA_ACCESS_GROUP_ID = 1
|
|
|
|
# BETA_ACCESS_ALLOW_URLS = (
|
|
|
|
# '/landing/',
|
|
|
|
# '/login/',
|
|
|
|
# '/messages/',
|
|
|
|
# )
|
2014-03-28 16:50:52 +00:00
|
|
|
|
|
|
|
# filer
|
|
|
|
THUMBNAIL_PROCESSORS = (
|
|
|
|
'easy_thumbnails.processors.colorspace',
|
|
|
|
'easy_thumbnails.processors.autocrop',
|
|
|
|
#'easy_thumbnails.processors.scale_and_crop',
|
|
|
|
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
|
|
|
'easy_thumbnails.processors.filters',
|
|
|
|
)
|
2014-04-03 11:31:43 +00:00
|
|
|
|
|
|
|
COVER_FOLDER_PK = 1
|
|
|
|
COVER_FOLDER_OWNER_PK = 1
|
2014-04-04 15:48:17 +00:00
|
|
|
|
2014-04-23 15:16:00 +00:00
|
|
|
FILER_STORAGES = {
|
2014-04-04 15:48:17 +00:00
|
|
|
'public': {
|
|
|
|
'main': {
|
|
|
|
'ENGINE': 'django.core.files.storage.FileSystemStorage',
|
2014-04-23 15:16:00 +00:00
|
|
|
'OPTIONS': {
|
|
|
|
'location': os.path.abspath(
|
|
|
|
os.path.join(MEDIA_ROOT, 'filer/public/')),
|
|
|
|
'base_url': '/files/',
|
|
|
|
},
|
|
|
|
'UPLOAD_TO': 'shelfzilla.utils.filer_generate_randomized',
|
|
|
|
'UPLOAD_TO_PREFIX': '',
|
2014-04-04 15:48:17 +00:00
|
|
|
},
|
|
|
|
'thumbnails': {
|
|
|
|
'ENGINE': 'django.core.files.storage.FileSystemStorage',
|
2014-04-23 15:16:00 +00:00
|
|
|
'OPTIONS': {
|
|
|
|
'location': os.path.abspath(
|
|
|
|
os.path.join(MEDIA_ROOT, 'filer/public/')),
|
|
|
|
'base_url': '/files/',
|
|
|
|
},
|
2014-04-04 15:48:17 +00:00
|
|
|
'THUMBNAIL_OPTIONS': {
|
2014-04-23 15:16:00 +00:00
|
|
|
'base_dir': 'thumbnails',
|
2014-04-04 15:48:17 +00:00
|
|
|
},
|
2014-04-23 15:16:00 +00:00
|
|
|
'UPLOAD_TO_PREFIX': '',
|
2014-04-04 15:48:17 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'private': {
|
|
|
|
'main': {
|
|
|
|
'ENGINE': 'filer.storage.PrivateFileSystemStorage',
|
|
|
|
'OPTIONS': {
|
|
|
|
'location': os.path.abspath(
|
2014-04-23 15:16:00 +00:00
|
|
|
os.path.join(MEDIA_ROOT, 'filer/private')),
|
2014-04-04 15:48:17 +00:00
|
|
|
'base_url': '/smedia/private/',
|
|
|
|
},
|
2014-04-23 15:16:00 +00:00
|
|
|
'UPLOAD_TO': 'shelfzilla.utils.filer_generate_randomized',
|
2014-04-04 15:48:17 +00:00
|
|
|
'UPLOAD_TO_PREFIX': '',
|
|
|
|
},
|
|
|
|
'thumbnails': {
|
|
|
|
'ENGINE': 'filer.storage.PrivateFileSystemStorage',
|
|
|
|
'OPTIONS': {
|
|
|
|
'location': os.path.abspath(
|
2014-04-23 15:16:00 +00:00
|
|
|
os.path.join(MEDIA_ROOT, 'filer/private_thumbnails')),
|
2014-04-04 15:48:17 +00:00
|
|
|
'base_url': '/smedia/private_thumbnails/',
|
|
|
|
},
|
|
|
|
'THUMBNAIL_OPTIONS': {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2014-06-20 09:09:17 +00:00
|
|
|
|
|
|
|
SOUTH_MIGRATION_MODULES = {
|
|
|
|
'easy_thumbnails': 'easy_thumbnails.south_migrations',
|
|
|
|
}
|
2014-08-24 10:56:24 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# ADMIN
|
|
|
|
#
|
|
|
|
SUIT_CONFIG = {
|
|
|
|
'ADMIN_NAME': 'Shelfzilla',
|
|
|
|
'SEARCH_URL': '',
|
|
|
|
'MENU': (
|
|
|
|
{
|
|
|
|
'label': 'Authorization',
|
|
|
|
'icon': 'icon-lock',
|
2015-01-10 09:58:50 +00:00
|
|
|
'models': ('account.user', 'auth.group', 'account.accesscode', )
|
2014-08-24 10:56:24 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'app': 'config',
|
|
|
|
'label': 'Settings',
|
|
|
|
'icon': 'icon-cog',
|
|
|
|
},
|
2014-09-14 19:13:31 +00:00
|
|
|
{
|
|
|
|
'app': 'blog',
|
|
|
|
'label': 'Blog',
|
|
|
|
'icon': 'icon-book',
|
|
|
|
},
|
2014-08-24 10:56:24 +00:00
|
|
|
{
|
|
|
|
'app': 'manga',
|
|
|
|
'label': 'Manga',
|
|
|
|
'icon': 'icon-book',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'label': 'Files',
|
|
|
|
'icon': 'icon-file',
|
|
|
|
'app': 'filer',
|
|
|
|
},
|
|
|
|
),
|
|
|
|
}
|
2014-09-14 19:13:31 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# CKEDITOR
|
|
|
|
#
|
|
|
|
CKEDITOR_UPLOAD_PATH = 'ckeditor/'
|
|
|
|
|
|
|
|
CKEDITOR_CONFIGS = {
|
|
|
|
'default': {
|
|
|
|
'toolbar': 'Standard',
|
|
|
|
'width': '100%',
|
|
|
|
},
|
|
|
|
}
|
2014-11-04 22:01:44 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# AUTH
|
|
|
|
#
|
|
|
|
AUTH_USER_MODEL = 'account.User'
|
2015-03-31 05:53:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# API
|
|
|
|
#
|
|
|
|
CORS_ORIGIN_ALLOW_ALL = True
|
|
|
|
|
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
|
|
'rest_framework.authentication.TokenAuthentication',
|
|
|
|
),
|
|
|
|
}
|
|
|
|
|
|
|
|
DJOSER = {
|
|
|
|
'DOMAIN': 'shelfzilla.com',
|
|
|
|
'SITE_NAME': 'Shelfzilla',
|
|
|
|
'PASSWORD_RESET_CONFIRM_URL': '#/password/reset/confirm/{uid}/{token}',
|
|
|
|
'ACTIVATION_URL': '#/activate/{uid}/{token}',
|
|
|
|
'LOGIN_AFTER_ACTIVATION': True,
|
|
|
|
'SEND_ACTIVATION_EMAIL': False,
|
|
|
|
}
|