Add UMAP_CUSTOM_TEMPLATES and UMAP_CUSTOM_STATICS

This commit is contained in:
Yohan Boniface 2018-06-02 17:20:44 +02:00
parent c0f6fcb448
commit 81919ce0f7
2 changed files with 8 additions and 4 deletions

View file

@ -35,8 +35,14 @@ else:
print('Loaded local config from', path) print('Loaded local config from', path)
for key in dir(d): for key in dir(d):
if key.isupper(): if key.isupper():
value = getattr(d, key)
if key.startswith('LEAFLET_STORAGE'): if key.startswith('LEAFLET_STORAGE'):
# Retrocompat pre 1.0, remove me in 1.1. # Retrocompat pre 1.0, remove me in 1.1.
globals()['UMAP' + key[15:]] = getattr(d, key) globals()['UMAP' + key[15:]] = value
elif key == 'UMAP_CUSTOM_TEMPLATES':
globals()['TEMPLATES'][0]['DIRS'].insert(0, value)
elif key == 'UMAP_CUSTOM_STATICS':
globals()['STATICFILES_DIRS'].insert(0, value)
print(globals()['STATICFILES_DIRS'])
else: else:
globals()[key] = getattr(d, key) globals()[key] = value

View file

@ -1,5 +1,3 @@
# -*- coding:utf-8 -*-
"""Base settings shared by all environments""" """Base settings shared by all environments"""
# Import global settings to make it easier to extend settings. # Import global settings to make it easier to extend settings.
from django.conf.global_settings import * # pylint: disable=W0614,W0401 from django.conf.global_settings import * # pylint: disable=W0614,W0401