mirror of
https://github.com/taroved/pol
synced 2025-05-16 14:20:10 -07:00
171 lines
4.5 KiB
Plaintext
171 lines
4.5 KiB
Plaintext
"""
|
|
Django settings for frontend project.
|
|
|
|
Generated by 'django-admin startproject' using Django 1.8.6.
|
|
|
|
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__)))
|
|
|
|
PROJECT_DIR = os.path.join(BASE_DIR, 'frontend')
|
|
|
|
# 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 = 'e2e%g-cu_f9=#^5=(8et$@(y+wu+dflyi2h)nim#r0-m=kqd^@'
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = True
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = (
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'django.contrib.sites',
|
|
'pipeline',
|
|
'frontend',
|
|
)
|
|
|
|
MIDDLEWARE_CLASSES = (
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'django.middleware.security.SecurityMiddleware',
|
|
)
|
|
|
|
ROOT_URLCONF = 'frontend.urls'
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [os.path.join(PROJECT_DIR, 'templates')],
|
|
'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',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'frontend.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'pol',
|
|
'USER': 'root',
|
|
'PASSWORD': 'toor',
|
|
'HOST': '127.0.0.1',
|
|
'PORT': '3306'
|
|
}
|
|
}
|
|
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
|
|
|
LANGUAGE_CODE = 'en'
|
|
|
|
LANGUAGES = (
|
|
('en', 'English'),
|
|
('ru', 'Russian'),
|
|
)
|
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/1.8/howto/static-files/
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
#STATICFILES_DIRS = (
|
|
# os.path.join(PROJECT_DIR, "assets"),
|
|
#)
|
|
|
|
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
|
|
|
|
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
|
|
|
|
STATICFILES_FINDERS = (
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
'pipeline.finders.PipelineFinder',
|
|
)
|
|
|
|
PIPELINE_COMPILERS = (
|
|
'pipeline.compilers.less.LessCompiler',
|
|
'pipeline.compilers.sass.SASSCompiler',
|
|
)
|
|
|
|
PIPELINE_CSS = {
|
|
'app': {
|
|
'source_filenames': (
|
|
'frontend/assets/stylesheets/application.css',
|
|
'frontend/assets/stylesheets/bootstrap_and_overrides.css.less',
|
|
'frontend/assets/stylesheets/wizard.css.scss',
|
|
),
|
|
'output_filename': 'frontend/css/app.css',
|
|
'extra_context': {
|
|
'media': 'all',
|
|
},
|
|
},
|
|
}
|
|
|
|
PIPELINE_JS = {
|
|
'app': {
|
|
'source_filenames': (
|
|
'frontend/assets/js/jquery.js',
|
|
'frontend/assets/js/jquery.browser.js',
|
|
'frontend/assets/js/bootstrap.js',
|
|
'frontend/assets/js/bootstrap_and_overrides.js',
|
|
'frontend/assets/js/setup-tool.js',
|
|
'frontend/assets/js/jquery.jfeed.js',
|
|
),
|
|
'output_filename': 'frontend/js/app.js',
|
|
}
|
|
}
|
|
|
|
DOWNLOADER_PAGE_URL = '/downloader?url='
|
|
FEED_PAGE_URL = '/feed/'
|
|
FEED1_PAGE_URL = '/feed1/'
|
|
DOWNLOADER_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36'
|
|
# limit of seconds in which user can access separate feed
|
|
FEED_REQUEST_PERIOD_LIMIT = 0
|