From dff1b6eaffa44c0d7006786d6a3ae1d0c5a59a9d Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Mon, 15 Feb 2021 16:00:52 -0500 Subject: [PATCH] fix: fixed static files for prod --- config/settings.py | 6 ++++-- innovate/static/innovate/confirm.css | 3 +++ innovate/templates/innovate/confirm.html | 5 +++-- innovate/templates/innovate/index.html | 2 +- innovate/templates/innovate/signup.html | 2 +- launchx/templates/launchx/base.html | 2 +- launchx/templates/launchx/landing.html | 2 +- launchx/templatetags/launchx_extras.py | 8 ++++++++ 8 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 innovate/static/innovate/confirm.css create mode 100644 launchx/templatetags/launchx_extras.py diff --git a/config/settings.py b/config/settings.py index 3c48f0c..cfb01ca 100644 --- a/config/settings.py +++ b/config/settings.py @@ -146,10 +146,12 @@ USE_TZ = True STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +STATIC_URL = '/static/' + if DEBUG: - STATIC_URL = '/static/' + STATIC_PREFIX = STATIC_URL else: - STATIC_URL = '/launchx/static/' + STATIC_PREFIX = '/launchx' + STATIC_URL CRISPY_TEMPLATE_PACK = 'bootstrap4' diff --git a/innovate/static/innovate/confirm.css b/innovate/static/innovate/confirm.css new file mode 100644 index 0000000..8063b1c --- /dev/null +++ b/innovate/static/innovate/confirm.css @@ -0,0 +1,3 @@ +body { + color: white +} \ No newline at end of file diff --git a/innovate/templates/innovate/confirm.html b/innovate/templates/innovate/confirm.html index 86b6389..b551a62 100644 --- a/innovate/templates/innovate/confirm.html +++ b/innovate/templates/innovate/confirm.html @@ -1,5 +1,5 @@ {% extends 'launchx/base.html' %} -{% load static %} +{% load launchx_extras %} {% block styles %} @@ -8,6 +8,7 @@ {% block content %}

Congrats!

-

You've successfully signed up for InnovateTJ, please check your email for a confirmation. We'll see you

+

You've successfully signed up for InnovateTJ, please check your email for a confirmation. We'll see you there!

+
{% endblock %} \ No newline at end of file diff --git a/innovate/templates/innovate/index.html b/innovate/templates/innovate/index.html index 9910949..90308ae 100644 --- a/innovate/templates/innovate/index.html +++ b/innovate/templates/innovate/index.html @@ -1,5 +1,5 @@ {% extends "launchx/base.html" %} -{% load static %} +{% load launchx_extras %} {% block styles %} diff --git a/innovate/templates/innovate/signup.html b/innovate/templates/innovate/signup.html index b90bbce..cbaab8c 100644 --- a/innovate/templates/innovate/signup.html +++ b/innovate/templates/innovate/signup.html @@ -1,5 +1,5 @@ {% extends 'launchx/base.html' %} -{% load static %} +{% load launchx_extras %} {% block styles %} diff --git a/launchx/templates/launchx/base.html b/launchx/templates/launchx/base.html index cce7ce7..3bc7932 100644 --- a/launchx/templates/launchx/base.html +++ b/launchx/templates/launchx/base.html @@ -1,4 +1,4 @@ -{% load static %} +{% load launchx_extras %} diff --git a/launchx/templates/launchx/landing.html b/launchx/templates/launchx/landing.html index cec4e94..71659c6 100644 --- a/launchx/templates/launchx/landing.html +++ b/launchx/templates/launchx/landing.html @@ -1,5 +1,5 @@ {% extends "launchx/base.html" %} -{% load static %} +{% load launchx_extras %} {% block styles %} diff --git a/launchx/templatetags/launchx_extras.py b/launchx/templatetags/launchx_extras.py new file mode 100644 index 0000000..2aec285 --- /dev/null +++ b/launchx/templatetags/launchx_extras.py @@ -0,0 +1,8 @@ +from django import template +from django.conf import settings + +register = template.Library() + +@register.simple_tag +def static(file_location): + return settings.STATIC_PREFIX + file_location \ No newline at end of file