<s> from os import environ <EOL> import json <EOL> import django . conf . global_settings as DEFAULT_SETTINGS <EOL> import dj_database_url <EOL> import locale <EOL> import logging <EOL> import sys <EOL> logger = logging . getLogger ( __name__ ) <EOL> import os <EOL> BASE_DIR = os . path . dirname ( os . path . dirname ( __file__ ) ) <EOL> CONFIGURATION = environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if not CONFIGURATION : <EOL> msg = """<STR_LIT>""" <EOL> raise SystemExit ( msg ) <EOL> if CONFIGURATION == '<STR_LIT>' : <EOL> DEBUG = True <EOL> TEMPLATE_DEBUG = True <EOL> CONFIGURATION = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> config = { } <EOL> else : <EOL> DEBUG = False <EOL> TEMPLATE_DEBUG = False <EOL> with open ( CONFIGURATION , '<STR_LIT:rb>' ) as f : <EOL> try : <EOL> config = json . load ( f ) <EOL> except ValueError as ve : <EOL> raise SystemExit ( "<STR_LIT>" . format ( ve ) ) <EOL> assert config . __class__ == dict , "<STR_LIT>" <EOL> SECRET_KEY = config . get ( '<STR_LIT>' ) <EOL> DEBUG = config . get ( '<STR_LIT>' , DEBUG ) <EOL> TEMPLATE_DEBUG = config . get ( '<STR_LIT>' , TEMPLATE_DEBUG ) <EOL> STATIC_ROOT = config . get ( '<STR_LIT>' , None ) <EOL> MEDIA_ROOT = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CACHE_DIRECTORY = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ALLOWED_HOSTS = config . get ( '<STR_LIT>' , [ ] ) <EOL> USE_X_FORWARDED_HOST = bool ( config . get ( '<STR_LIT>' , False ) ) <EOL> DATABASE_URL = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> DATABASES = dict ( default = dj_database_url . parse ( DATABASE_URL ) ) <EOL> TIME_ZONE = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> SHORT_DATE_FORMAT = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> LANGUAGE_CODE = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> STATIC_URL = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> MAINTENANCE_MESSAGE = config . get ( '<STR_LIT>' , None ) <EOL> ENTRIES_PER_PAGE = int ( config . get ( '<STR_LIT>' , <NUM_LIT:30> ) ) <EOL> TRUSTED_HOSTS = config . get ( '<STR_LIT>' , [ ] ) <EOL> def get_required ( key ) : <EOL> value = config . get ( key ) <EOL> if not value : <EOL> raise SystemExit ( '<STR_LIT>' . format ( key ) ) <EOL> return value <EOL> IBAN_ACCOUNT_NUMBER = get_required ( '<STR_LIT>' ) <EOL> BIC_CODE = get_required ( '<STR_LIT>' ) <EOL> BANK_NAME = get_required ( '<STR_LIT>' ) <EOL> BILLING_FROM_EMAIL = get_required ( '<STR_LIT>' ) <EOL> BILLING_CC_EMAIL = config . get ( '<STR_LIT>' ) <EOL> BILL_SUBJECT = get_required ( '<STR_LIT>' ) <EOL> REMINDER_SUBJECT = get_required ( '<STR_LIT>' ) <EOL> BILLING_ACCOUNTING_MAP = get_required ( '<STR_LIT>' ) <EOL> BILL_DAYS_BEFORE_CYCLE = int ( get_required ( '<STR_LIT>' ) ) <EOL> BILL_DAYS_TO_DUE = int ( get_required ( '<STR_LIT>' ) ) <EOL> REMINDER_GRACE_DAYS = int ( get_required ( '<STR_LIT>' ) ) <EOL> ENABLE_REMINDERS = config . get ( '<STR_LIT>' , False ) <EOL> BILL_ATTACH_PDF = config . get ( '<STR_LIT>' , True ) <EOL> UNIX_EMAIL_DOMAIN = config . get ( '<STR_LIT>' , None ) <EOL> SERVER_EMAIL = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> FROM_EMAIL = get_required ( '<STR_LIT>' ) <EOL> SYSADMIN_EMAIL = get_required ( '<STR_LIT>' ) <EOL> ORGANIZATION_REG_ID = get_required ( "<STR_LIT>" ) <EOL> BUSINESS_ID = get_required ( "<STR_LIT>" ) <EOL> FONT_PATH = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> IMG_PATH = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> PRODUCTION = config . get ( '<STR_LIT>' , False ) <EOL> LOGIN_REDIRECT_URL = '<STR_LIT>' <EOL> SITE_ID = <NUM_LIT:1> <EOL> USE_I18N = True <EOL> USE_L10N = True <EOL> USE_TZ = False <EOL> locale . setlocale ( locale . LC_ALL , config . get ( "<STR_LIT>" , '<STR_LIT>' ) ) <EOL> STATICFILES_FINDERS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> TEMPLATE_LOADERS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> LOCALE_PATHS = ( <EOL> os . path . join ( BASE_DIR , '<STR_LIT>' ) , <EOL> os . path . join ( BASE_DIR , '<STR_LIT>' ) , <EOL> ) <EOL> STATICFILES_DIRS = ( <EOL> os . path . join ( BASE_DIR , '<STR_LIT>' ) , <EOL> os . path . join ( BASE_DIR , '<STR_LIT>' ) , <EOL> ) <EOL> TEMPLATE_DIRS = ( <EOL> os . path . join ( BASE_DIR , '<STR_LIT>' ) , <EOL> ) <EOL> TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS . TEMPLATE_CONTEXT_PROCESSORS + ( <EOL> "<STR_LIT>" , <EOL> ) <EOL> INSTALLED_APPS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> MIDDLEWARE_CLASSES = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> if DEBUG : <EOL> SESSION_COOKIE_SECURE = False <EOL> else : <EOL> SESSION_COOKIE_SECURE = True <EOL> SESSION_COOKIE_HTTPONLY = True <EOL> ROOT_URLCONF = '<STR_LIT>' <EOL> WSGI_APPLICATION = '<STR_LIT>' <EOL> LOGIN_URL = '<STR_LIT>' <EOL> MESSAGE_STORAGE = '<STR_LIT>' <EOL> ADMINS = config . get ( '<STR_LIT>' ) <EOL> MANAGERS = config . get ( '<STR_LIT>' ) <EOL> LOGGING = { <EOL> '<STR_LIT:version>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:class>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT:null>' : { <EOL> '<STR_LIT:class>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT:class>' : '<STR_LIT>' <EOL> } <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : False , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : False , <EOL> } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT>' ] , '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT>' ] , '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT>' ] , '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT>' ] , '<STR_LIT>' : '<STR_LIT>' } , <EOL> } <EOL> } <EOL> EMAIL_SUBJECT_PREFIX = get_required ( '<STR_LIT>' ) <EOL> EMAIL_MBOX_FILE_PATH = config . get ( '<STR_LIT>' , None ) <EOL> if EMAIL_MBOX_FILE_PATH : <EOL> logger . info ( "<STR_LIT>" . format ( EMAIL_MBOX_FILE_PATH ) ) <EOL> EMAIL_BACKEND = '<STR_LIT>' <EOL> elif not PRODUCTION : <EOL> logger . info ( "<STR_LIT>" ) <EOL> EMAIL_BACKEND = '<STR_LIT>' <EOL> else : <EOL> pass <EOL> AUTH_USE_LDAP = config . get ( '<STR_LIT>' , False ) <EOL> if AUTH_USE_LDAP : <EOL> from django_auth_ldap . config import LDAPSearch <EOL> from django_auth_ldap . config import GroupOfNamesType <EOL> import ldap <EOL> AUTHENTICATION_BACKENDS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> AUTH_LDAP_SERVER_URI = config . get ( '<STR_LIT>' ) <EOL> AUTH_LDAP_START_TLS = config . get ( '<STR_LIT>' , False ) <EOL> AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = config . get ( <EOL> '<STR_LIT>' , True ) <EOL> AUTH_LDAP_BIND_DN = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> AUTH_LDAP_BIND_PASSWORD = config . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> AUTH_LDAP_USER_DN_TEMPLATE = config . get ( '<STR_LIT>' ) <EOL> assert AUTH_LDAP_USER_DN_TEMPLATE is None or '<STR_LIT>' in AUTH_LDAP_USER_DN_TEMPLATE , "<STR_LIT>" <EOL> AUTH_LDAP_USER_ATTR_MAP = config . get ( '<STR_LIT>' , <EOL> { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:email>" : "<STR_LIT>" , <EOL> } ) <EOL> AUTH_LDAP_FIND_GROUP_PERMS = config . get ( '<STR_LIT>' , False ) <EOL> if AUTH_LDAP_FIND_GROUP_PERMS : <EOL> AUTH_LDAP_GROUP_SEARCH_DN = config . get ( '<STR_LIT>' ) <EOL> AUTH_LDAP_GROUP_SEARCH_FILTER = config . get ( <EOL> '<STR_LIT>' ) <EOL> assert AUTH_LDAP_GROUP_SEARCH_DN , "<STR_LIT>" <EOL> assert AUTH_LDAP_GROUP_SEARCH_FILTER , "<STR_LIT>" <EOL> AUTH_LDAP_REQUIRE_GROUP = config . get ( '<STR_LIT>' ) <EOL> AUTH_LDAP_GROUP_SEARCH = LDAPSearch ( AUTH_LDAP_GROUP_SEARCH_DN , <EOL> ldap . SCOPE_ONELEVEL , <EOL> AUTH_LDAP_GROUP_SEARCH_FILTER ) <EOL> AUTH_LDAP_GROUP_TYPE = GroupOfNamesType ( ) <EOL> AUTH_LDAP_MIRROR_GROUPS = True <EOL> AUTH_LDAP_CACHE_GROUPS = config . get ( '<STR_LIT>' , True ) <EOL> AUTH_LDAP_GROUP_CACHE_TIMEOUT = config . get ( <EOL> '<STR_LIT>' , <NUM_LIT> ) <EOL> AUTH_LDAP_USER_FLAGS_BY_GROUP = config . get ( <EOL> '<STR_LIT>' , { } ) <EOL> AUTH_LDAP_ALWAYS_UPDATE_USER = config . get ( '<STR_LIT>' , <EOL> True ) </s>
