# -*- coding: utf-8 -*- # Django settings for project project. import os from django.conf import global_settings path = lambda *xs: os.path.abspath(os.path.join(os.path.dirname(__file__), *xs)) DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS #DATABASES = { #'default': { #'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. #'NAME': '', # Or path to database file if using sqlite3. #The following settings are not used with sqlite3: #'USER': '', #'PASSWORD': '', #'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. #'PORT': '', # Set to empty string for default. #} #} # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. TIME_ZONE = 'Europe/Moscow' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'ru' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/var/www/example.com/media/" MEDIA_ROOT = path('../public_html/media') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://example.com/media/", "http://media.example.com/" MEDIA_URL = '/m/' # 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: "/var/www/example.com/static/" STATIC_ROOT = path('../public_html/static') # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" STATIC_URL = '/s/' # Additional locations of static files STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. path('static'), ) # 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', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. SECRET_KEY = 'n*t&j(gng8ag57esyvn)&t8v=d@$#-(aeou@oc!plsu!g0fyv6' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: 'django.middleware.clickjacking.XFrameOptionsMiddleware', # django-cms 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware', #'cms.middleware.language.LanguageCookieMiddleware', 'project.commons.middleware.FullBaseUrlMiddleware', ) ROOT_URLCONF = 'project.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'project.wsgi.application' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. path('templates'), ) INSTALLED_APPS = ( 'admin_tools', #'admin_tools.theming', #'admin_tools.menu', 'admin_tools.dashboard', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: 'django.contrib.admindocs', 'django.contrib.humanize', 'django.contrib.sitemaps', 'tinymce', 'captcha', 'sorl.thumbnail', 'pytils', 'cms', 'mptt', 'menus', 'sekizai', 'cms.plugins.file', 'cms.plugins.flash', 'cms.plugins.link', 'cms.plugins.picture', 'cms.plugins.text', 'cms.plugins.video', 'project.commons', 'project.banners', 'project.cmsplugin_htmlsitemap', 'project.feedback', 'project.teasers', 'project.guestbook', 'project.pensfonds', 'project.npfs', 'project.articles', 'djapian', 'project.search', 'django_extensions', # keep it last 'south', ) # 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 when DEBUG=False. # 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, 'formatters': { 'standard': { 'format': "[%(asctime)s] %(levelname)s %(message)s", }, }, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'logfile_feedback': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', 'filename': path('../log/feedback.log'), 'maxBytes': 2*1024*1024, 'backupCount': 5, 'formatter': 'standard', }, 'logfile_guestbook': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', 'filename': path('../log/guestbook.log'), 'maxBytes': 2*1024*1024, 'backupCount': 5, 'formatter': 'standard', }, 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, 'feedback': { 'handlers': ['logfile_feedback'], 'level': 'DEBUG', }, 'guestbook': { 'handlers': ['logfile_guestbook'], 'level': 'DEBUG', }, } } SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( 'django.core.context_processors.request', 'cms.context_processors.media', 'sekizai.context_processors.sekizai', 'project.feedback.context_processors.forms', ) SOUTH_MIGRATION_MODULES = { 'captcha': 'captcha.south_migrations', } PLACEHOLDER_FRONTEND_EDITING = True CMS_TEMPLATE_INHERITANCE = False CMS_SEO_FIELDS = True CMS_MENU_TITLE_OVERWRITE = True gettext = lambda s: s LANGUAGES = ( ('ru', gettext('Russian')), ) CMS_TEMPLATES = ( ('cms/pages/article.html', u'Статья'), ('cms/pages/inner-level-3.html', u'Внутренняя 3-го уровня'), ('cms/pages/inner-level-2-with-index.html', u'Внутренняя 2-го уровня'), ('cms/pages/index.html', u'Главная страница'), ('cms/pages/company-page.html', u'Страница фондов'), ('cms/pages/sitemap.html', u'Карта сайта'), ) CMS_PLACEHOLDER_CONF = { 'content-main': { 'name': u'Основной контент', }, 'content-main2': { 'name': u'Основной контент 2', }, 'content-main3': { 'name': u'Основной контент 3', }, 'content-main4': { 'name': u'Основной контент 4', }, 'content-main5': { 'name': u'Основной контент 5', }, 'content-main6': { 'name': u'Основной контент 6', }, 'content-main7': { 'name': u'Основной контент 7', }, 'content-left': { 'name': u'Контент левой колонки', }, 'content-right': { 'name': u'Контент правой колонки', }, 'category-desc': { 'name': u'Описание категории', }, 'on-index': { 'name': u'Блок на главной', 'plugins': ['TextPlugin', 'PicturePlugin'], }, 'page-teasers': { 'name': u'Тизеры', 'plugins': ['TeasersPlugin'], }, 'page-teasers2': { 'name': u'Тизеры 2', 'plugins': ['TeasersPlugin'], }, 'article-contents': { 'name': u'Содержание', }, } TINYMCE_DEFAULT_CONFIG = { 'theme': "advanced", 'plugins': "autolink,lists,table,paste,style", 'theme_advanced_buttons1': ",bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,styleprops,removeformat,styleselect", 'theme_advanced_buttons2': "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,images,cleanup,help,code,|,charmap,insertdate,inserttime", 'theme_advanced_buttons3': "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,fullscreen,preview,print,", 'theme_advanced_toolbar_location': "top", 'theme_advanced_toolbar_align': "left", 'theme_advanced_statusbar_location': "bottom", 'theme_advanced_resizing': True, 'convert_urls': False, 'relative_urls': False, 'remove_script_host': False, 'style_formats': [ {'title': 'таблица фондов', 'selector': 'table', 'classes': 'mce-fond-table'}, ], 'content_css' : "/static/css/tinymce.css", 'body_class': "mce_body", } DJAPIAN_DATABASE_PATH = path('../djapian_spaces/') DJAPIAN_STEMMING_LANG = 'ru' ADMIN_TOOLS_INDEX_DASHBOARD = 'project.admin_dashboard.CustomIndexDashboard' # cache settings COMMON_CACHE_PREFIX = 'pensfond_new_' CMS_CACHE_PREFIX = '%scms-' % COMMON_CACHE_PREFIX CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', } } THOUSAND_SEPARATOR = ' ' # Yandex.Webmaster settings YANDEX_WEBMASTER_DOMAIN = 'https://pensionnyj-fond.ru' YANDEX_WEBMASTER_TOKEN = None # DEFINE IN local_settings.py !!! YANDEX_WEBMASTER_TOKEN_EXPIRES = None # DEFINE IN local_settings.py !!! # email settings # DEFINE IN local_settings.py !!! SERVER_EMAIL = u'ERROR Пенсионный фонд ' # email that error messages come from DEFAULT_FROM_EMAIL = u'Пенсионный фонд ' # email that other messages come from. default email for EmailMessage FEEDBACK_EMAILS = ['alexander@air51.ru', 'lu@air51.ru'] try: from project.local_settings import * except ImportError: pass