From 69a17b60229be6e3fe94d68c8056bf71c5d6d9c7 Mon Sep 17 00:00:00 2001 From: Kurt Grandis Date: Thu, 7 Sep 2017 15:03:43 -0400 Subject: [PATCH 1/4] explicitly define STATIC_ROOT. All static files are now collected to a directory 'staticfiles' in the project root --- .gitignore | 3 ++- staticfiles/.ignoreme | 0 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 staticfiles/.ignoreme diff --git a/.gitignore b/.gitignore index 81d84de8..8b6ee360 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ media/ federated-analytics.js *.conf lrs/celery.py -*.ini \ No newline at end of file +*.ini +staticfiles/* diff --git a/staticfiles/.ignoreme b/staticfiles/.ignoreme new file mode 100644 index 00000000..e69de29b From bb658dc141ce2ee9f72a93d714adbcfac3ddbcba Mon Sep 17 00:00:00 2001 From: Kurt Grandis Date: Thu, 7 Sep 2017 15:35:21 -0400 Subject: [PATCH 2/4] explicitly define static root --- adl_lrs/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adl_lrs/settings.py b/adl_lrs/settings.py index b710ea32..022073ea 100644 --- a/adl_lrs/settings.py +++ b/adl_lrs/settings.py @@ -6,6 +6,7 @@ # Root of LRS SETTINGS_DIR = dirname(abspath(__file__)) PROJECT_ROOT = dirname(dirname(SETTINGS_DIR)) +BASE_DIR = path.join(SETTINGS_DIR, '..') config = RawConfigParser() config.read(SETTINGS_DIR+'/settings.ini') @@ -86,7 +87,7 @@ # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = '' +STATIC_ROOT = path.join(BASE_DIR, 'staticfiles') # URL prefix for static files. # Example: "http://media.lawrence.com/static/" From efb48edd6a21d408e6cfc746c5e124b6de7e26b0 Mon Sep 17 00:00:00 2001 From: Kurt Grandis Date: Fri, 8 Sep 2017 14:09:16 -0400 Subject: [PATCH 3/4] update templates to make use of the 'static' template tag instead of manually using STATIC_URL --- adl_lrs/templates/base.html | 11 ++++++----- adl_lrs/templates/home.html | 6 ++++-- adl_lrs/templates/me.html | 8 +++++--- adl_lrs/templates/my_activity_states.html | 8 +++++--- adl_lrs/templates/my_hooks.html | 5 +++-- adl_lrs/templates/my_statements.html | 6 ++++-- adl_lrs/templates/oauth_authorize_client.html | 8 +++++--- adl_lrs/templates/oauth_verifier_pin.html | 6 ++++-- adl_lrs/templates/regclient.html | 8 +++++--- adl_lrs/templates/register.html | 6 ++++-- adl_lrs/templates/registration/login.html | 6 ++++-- .../registration/password_reset_complete.html | 6 ++++-- .../registration/password_reset_confirm.html | 6 ++++-- .../templates/registration/password_reset_done.html | 6 ++++-- .../templates/registration/password_reset_form.html | 6 ++++-- adl_lrs/templates/validator.html | 6 ++++-- 16 files changed, 69 insertions(+), 39 deletions(-) diff --git a/adl_lrs/templates/base.html b/adl_lrs/templates/base.html index 4eafe653..aab3d75a 100644 --- a/adl_lrs/templates/base.html +++ b/adl_lrs/templates/base.html @@ -1,3 +1,4 @@ +{% load static from staticfiles %} @@ -5,18 +6,18 @@ - - + + - + {% block extra_css %}{% endblock extra_css %} {% block title %}ADL LRS{% endblock title %} @@ -50,4 +51,4 @@ {% block content %}{% endblock content %} {% block extra_js %}{% endblock extra_js %} - \ No newline at end of file + diff --git a/adl_lrs/templates/home.html b/adl_lrs/templates/home.html index 0c4d8a2d..d916a81e 100644 --- a/adl_lrs/templates/home.html +++ b/adl_lrs/templates/home.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load static from staticfiles %} + {% block extra_css %}