amiibofindr/amiibofindr/settings/base.py

170 lines
4.4 KiB
Python
Raw Normal View History

2015-09-03 16:37:41 +00:00
# coding: utf-8
2015-06-02 21:35:27 +00:00
"""
Django settings for amiibofindr project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '0101010101'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
2015-08-29 17:08:41 +00:00
'suit',
2015-06-02 21:35:27 +00:00
'django.contrib.admin',
2015-08-31 22:05:20 +00:00
'django.contrib.sites', # For allauth
2015-06-02 21:35:27 +00:00
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
2015-06-15 22:38:43 +00:00
# third party
'reversion',
2015-06-16 22:17:36 +00:00
'import_export',
'easy_thumbnails',
2015-07-01 06:39:41 +00:00
'django_extensions',
2015-06-15 22:38:43 +00:00
2015-08-31 22:05:20 +00:00
# Auth
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.twitter',
2015-10-11 07:50:21 +00:00
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.instagram',
2015-08-31 22:05:20 +00:00
2015-06-15 22:38:43 +00:00
# own apps
'amiibofindr.apps.core',
'amiibofindr.apps.amiibo',
2015-06-22 19:12:26 +00:00
'amiibofindr.apps.shop',
2015-06-16 21:40:53 +00:00
'amiibofindr.apps.home',
2015-09-10 20:31:55 +00:00
'amiibofindr.apps.profile',
2015-07-01 21:12:26 +00:00
'amiibofindr.apps.notifications',
2015-06-02 21:35:27 +00:00
)
MIDDLEWARE_CLASSES = (
2015-06-15 22:38:43 +00:00
'reversion.middleware.RevisionMiddleware',
2015-06-02 21:35:27 +00:00
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
2015-09-10 18:15:26 +00:00
'amiibofindr.apps.core.middleware.LanguageMiddleware',
'django.middleware.locale.LocaleMiddleware',
2015-06-02 21:35:27 +00:00
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
2015-06-25 19:02:53 +00:00
'htmlmin.middleware.HtmlMinifyMiddleware',
'htmlmin.middleware.MarkRequestMiddleware',
2015-06-02 21:35:27 +00:00
)
ROOT_URLCONF = 'amiibofindr.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
2015-06-16 21:40:53 +00:00
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
2015-06-02 21:35:27 +00:00
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
2015-06-16 21:40:53 +00:00
'amiibofindr.apps.amiibo.context_processors.collections',
2015-06-25 18:46:45 +00:00
'amiibofindr.apps.amiibo.context_processors.currencies',
2015-06-22 22:46:51 +00:00
'amiibofindr.apps.core.context_processors.debug',
2015-06-25 18:46:45 +00:00
'amiibofindr.apps.core.context_processors.files',
'amiibofindr.apps.core.context_processors.i18n',
2015-09-08 19:24:54 +00:00
'amiibofindr.apps.amiibo.context_processors.user_amiibo',
2015-06-02 21:35:27 +00:00
],
},
},
]
WSGI_APPLICATION = 'amiibofindr.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/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.8/topics/i18n/
LANGUAGE_CODE = 'en'
2015-09-03 16:37:41 +00:00
LANGUAGES = (
('en', u'English'),
2015-09-03 16:37:41 +00:00
('es', u'Español'),
)
2015-06-02 21:35:27 +00:00
2015-06-15 22:38:43 +00:00
TIME_ZONE = 'Europe/Madrid'
2015-06-02 21:35:27 +00:00
USE_I18N = True
USE_L10N = True
USE_TZ = True
2015-09-03 16:37:41 +00:00
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
2015-06-02 21:35:27 +00:00
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
2015-06-16 20:11:00 +00:00
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
2015-06-15 22:04:34 +00:00
MEDIA_URL = '/media/'
2015-08-31 22:05:20 +00:00
# Auth
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)
# Sites and social auth
2015-09-01 18:25:22 +00:00
ACCOUNT_LOGOUT_ON_GET = True
ACCOUNT_USERNAME_MIN_LENGTH = 3
2015-09-01 18:25:22 +00:00
2015-08-31 22:05:20 +00:00
SITE_ID = 1
2015-09-01 18:25:22 +00:00
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/account/login/'