Exemplo n.º 1
0
"""
Django settings for this project
"""
import os
from rpg.util.configurator import Configurator


PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)))
WORKSPACE = os.path.abspath(os.path.join(PROJECT_PATH, "../"))
CONFIG = Configurator(PROJECT_PATH)

DEBUG = CONFIG.debug # SECURITY WARNING: don't run with debug turned on in production!
TEMPLATE_DEBUG = CONFIG.debug
ALLOWED_HOSTS = CONFIG.get("ALLOWED_HOSTS", ["*"])
ADMINS = CONFIG.get("ADMINS", [])
EXTERNAL_REQUEST_TIMEOUT = float(CONFIG.get('EXTERNAL_REQUEST_TIMEOUT'))
SECRET_KEY = CONFIG.secret_key

URI = CONFIG.get("URI")
if URI.endswith("/"):
    URI = URI[0:len(URI) - 1]

NEWRELIC = CONFIG.get("NEWRELIC", None)
if NEWRELIC:
    NEWRELIC = os.path.abspath(os.path.join(PROJECT_PATH, NEWRELIC))

if CONFIG.get("LOGGING", None):
    if CONFIG.get("LOGGING").get("enabled", False):
        LOGGING = CONFIG.get("LOGGING")
        LOGGING.pop("enabled")
Exemplo n.º 2
0
"""
Django settings for this project
"""
import os
from rpg.util.configurator import Configurator


PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)))
WORKSPACE = os.path.abspath(os.path.join(PROJECT_PATH, "../"))
CONFIG = Configurator(PROJECT_PATH)

DEBUG = CONFIG.debug # SECURITY WARNING: don't run with debug turned on in production!
TEMPLATE_DEBUG = CONFIG.debug
ALLOWED_HOSTS = CONFIG.get("ALLOWED_HOSTS", ["*"])
ADMINS = CONFIG.get("ADMINS", [])
EXTERNAL_REQUEST_TIMEOUT = float(CONFIG.get('EXTERNAL_REQUEST_TIMEOUT'))
SECRET_KEY = CONFIG.secret_key

URI = CONFIG.get("URI")
if URI.endswith("/"):
    URI = URI[0:len(URI) - 1]

NEWRELIC = CONFIG.get("NEWRELIC", False)
# if LOCAL_MODE is False and config.contains("LOGGING"):
#     LOGGING = config.get("LOGGING")


IMAGE_SIZES = CONFIG.get("IMAGE_SIZES")

# Application definition
ROOT_URLCONF = 'metrics.urls'