def _get_proxies(): proxies = [] grip_proxies = os.environ.get('GRIP_PROXIES') if grip_proxies: proxies.extend(json.loads(grip_proxies)) grip_url = os.environ.get('GRIP_URL') if grip_url: proxies.append(parse_grip_uri(grip_url)) return proxies
def _get_proxies(): proxies = getattr(settings, 'GRIP_PROXIES', []) grip_url = getattr(settings, 'GRIP_URL', None) if grip_url: proxies.append(parse_grip_uri(grip_url)) return proxies
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = 'staticfiles' from gripcontrol import parse_grip_uri if 'GRIP_URL' in os.environ: GRIP_PROXIES = [parse_grip_uri(os.environ['GRIP_URL'])] else: GRIP_PROXIES = []
"version": 1, "disable_existing_loggers": False, "formatters": { "verbose": { "format": "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", "datefmt": "%Y-%m-%d %H:%M:%S", }, "simple": {"format": "%(levelname)s %(message)s"}, }, "handlers": { "null": {"level": "DEBUG", "class": "logging.NullHandler"}, "console": {"level": "DEBUG", "class": "logging.StreamHandler", "formatter": "verbose"}, }, "loggers": { "api": {"handlers": ["console"], "level": "DEBUG"}, "website": {"handlers": ["console"], "level": "DEBUG"}, }, } REDIS_HOST = os.environ.get("REDIS_HOST") if "REDIS_PORT" in os.environ: REDIS_PORT = int(os.environ["REDIS_PORT"]) if "REDIS_DB" in os.environ: REDIS_DB = int(os.environ["REDIS_DB"]) from gripcontrol import parse_grip_uri GRIP_PROXES = [] if "GRIP_URL" in os.environ: GRIP_PROXIES = [parse_grip_uri(os.environ["GRIP_URL"])]
}, 'handlers': { 'null': { 'level': 'DEBUG', 'class': 'logging.NullHandler', }, 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'verbose' } }, 'loggers': { 'leaderboardapp': { 'handlers': ['console'], 'level': 'DEBUG', }, 'dblistener': { 'handlers': ['console'], 'level': 'DEBUG', } } } from gripcontrol import parse_grip_uri GRIP_PREFIX = 'leaderboard-' GRIP_PROXIES = [parse_grip_uri(os.environ['GRIP_URL'])] LEADERBOARD_API_BASE = os.environ.get('API_BASE', '')