from derpconf.config import Config BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if 'test' in sys.argv: config_file = os.path.join(BASE_DIR, 'politicos', 'tests.config') else: config_file = os.path.join(BASE_DIR, 'politicos', 'local.config') if os.path.isfile(config_file): conf = Config.load(config_file) else: conf = Config() # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = conf.get('SECRET_KEY', 'REPLACE-THIS-IN-CONFIG-LOCAL') DEBUG = conf.get('DEBUG', True) ALLOWED_HOSTS = conf.get('ALLOWED_HOSTS', []) DEFAULT_INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'corsheaders', 'bootstrap3',
def INSTANCE(x): return os.path.join(os.path.dirname(__file__), x) if 'test' in sys.argv: config_file = INSTANCE('tests.config') else: config_file = INSTANCE('local.config') if os.path.isfile(config_file): conf = Config.load(config_file) else: conf = Config() DEBUG = conf.get('DEBUG', True) ADMINS = conf.get('ADMINS', ()) MANAGERS = ADMINS DEAFAULT_DATABASE = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': INSTANCE('db.sqlite3'), 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', } }
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if 'test' in sys.argv: config_file = os.path.join(BASE_DIR, 'politicos', 'tests.config') else: config_file = os.path.join(BASE_DIR, 'politicos', 'local.config') if os.path.isfile(config_file): conf = Config.load(config_file) else: conf = Config() # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = conf.get('SECRET_KEY', 'REPLACE-THIS-IN-CONFIG-LOCAL') DEBUG = conf.get('DEBUG', True) ALLOWED_HOSTS = conf.get('ALLOWED_HOSTS', []) DEFAULT_INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'corsheaders', 'bootstrap3',
import sys from derpconf.config import Config INSTANCE = lambda *x: os.path.join(os.path.dirname(__file__), *x) if 'test' in sys.argv: config_file = INSTANCE('tests.config') else: config_file = INSTANCE('local.config') if os.path.isfile(config_file): conf = Config.load(config_file) else: conf = Config() DEBUG = conf.get('DEBUG', True) TEMPLATE_DEBUG = DEBUG ADMINS = conf.get('ADMINS', ()) MANAGERS = ADMINS DEAFAULT_DATABASE = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': INSTANCE('db.sqlite3'), 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', }
import sys from derpconf.config import Config INSTANCE = lambda *x: os.path.join(os.path.dirname(__file__), *x) if "test" in sys.argv: config_file = INSTANCE("tests.config") else: config_file = INSTANCE("local.config") if os.path.isfile(config_file): conf = Config.load(config_file) else: conf = Config() DEBUG = conf.get("DEBUG", True) TEMPLATE_DEBUG = DEBUG ADMINS = conf.get("ADMINS", ()) MANAGERS = ADMINS DEAFAULT_DATABASE = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": INSTANCE("db.sqlite3"), "USER": "", "PASSWORD": "", "HOST": "", "PORT": "", }