From 6c957e3ce4a3d01a2ac3d883fe0a88aacc6523d4 Mon Sep 17 00:00:00 2001 From: Krophil Date: Wed, 4 Oct 2017 22:46:52 +0200 Subject: [PATCH] Integrate external_res variable --- CONTRIBUTING.md | 1 + core/templates/core/base.jinja | 11 +++++++---- sith/settings.py | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ceb4c4e3..9dc4aeab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,7 @@ Avec cette commande, tu clones le sith AE dans le dossier courant. Maintenant, faut passer le sith en mode debug dans le fichier de settings personnalisé. echo "DEBUG=True" > sith/settings_custom.py + echo 'EXTERNAL_RES = "False"' >> sith/settings_custom.py echo 'SITH_URL = "localhost:8000"' >> sith/settings_custom.py Enfin, il s'agit de créer la base de donnée de test lors de la première utilisation diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index a7951efe..8086ac8d 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -7,15 +7,18 @@ - - {% if settings.DEBUG %} - - {% else %} + {% if settings.EXTERNAL_RES %} + + + + {% else %} + + {% endif %} {% endblock %} diff --git a/sith/settings.py b/sith/settings.py index 4570e660..43db370d 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -227,6 +227,9 @@ LOCALE_PATHS = ( PHONENUMBER_DEFAULT_REGION = "FR" +# Whether to use CDNs (True) or local ressources (False) for JS and CSS +EXTERNAL_RES = True + # Medias MEDIA_ROOT = './data/' MEDIA_URL = '/data/'