if KPI_PREFIX and KPI_PREFIX != '/': STATIC_URL = '{}/{}'.format(KPI_PREFIX, STATIC_URL) from django.conf.global_settings import LOGIN_URL LOGIN_URL = '{}/{}'.format(KPI_PREFIX, LOGIN_URL) STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'jsapp'), os.path.join(BASE_DIR, 'static'), ( 'mocha', os.path.join(BASE_DIR, 'node_modules', 'mocha'), ), ) from cachebuster.detectors import git CACHEBUSTER_UNIQUE_STRING = git.unique_string(__file__)[:6] if os.path.exists(os.path.join(BASE_DIR, 'dkobo', 'jsapp')): STATICFILES_DIRS = STATICFILES_DIRS + ( os.path.join(BASE_DIR, 'dkobo', 'jsapp'), os.path.join(BASE_DIR, 'dkobo', 'dkobo', 'static'), ) REST_FRAMEWORK = { 'URL_FIELD_NAME': 'url', 'DEFAULT_PAGINATION_CLASS': 'kpi.serializers.Paginated', 'PAGE_SIZE': 100, 'DEFAULT_AUTHENTICATION_CLASSES': [
KPI_PREFIX = os.environ.get('KPI_PREFIX', 'False') KPI_PREFIX = False if KPI_PREFIX.lower() == 'false' else KPI_PREFIX # KPI_PREFIX should be set in the environment when running in a subdirectory if KPI_PREFIX and KPI_PREFIX != '/': STATIC_URL = '{}/{}'.format(KPI_PREFIX, STATIC_URL) from django.conf.global_settings import LOGIN_URL LOGIN_URL = '{}/{}'.format(KPI_PREFIX, LOGIN_URL) STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'jsapp'), os.path.join(BASE_DIR, 'static'), ) from cachebuster.detectors import git CACHEBUSTER_UNIQUE_STRING = git.unique_string(__file__)[:6] if os.path.exists(os.path.join(BASE_DIR, 'dkobo', 'jsapp')): STATICFILES_DIRS = STATICFILES_DIRS + ( os.path.join(BASE_DIR, 'dkobo', 'jsapp'), os.path.join(BASE_DIR, 'dkobo', 'dkobo', 'static'), ) REST_FRAMEWORK = { 'URL_FIELD_NAME': 'url', 'DEFAULT_PAGINATION_CLASS': 'kpi.serializers.Paginated', 'PAGE_SIZE': 100, 'DEFAULT_AUTHENTICATION_CLASSES': [ # SessionAuthentication and BasicAuthentication would be included by # default 'rest_framework.authentication.SessionAuthentication',