Fix context processor by including it in settings.py

This commit is contained in:
Neil Martinsen-Burrell 2023-11-09 13:40:24 -06:00
parent 11e7abea52
commit 2c20db83fa
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
3 changed files with 5 additions and 2 deletions

View file

@ -27,6 +27,8 @@ services:
- DJANGO_DEBUG=True - DJANGO_DEBUG=True
# Tell Django where it is being hosted # Tell Django where it is being hosted
- DJANGO_BASE_URL=http://localhost:8080 - DJANGO_BASE_URL=http://localhost:8080
# Is this a production environment
- IS_PRODUCTION
# Public site URL link # Public site URL link
- GETGOV_PUBLIC_SITE_URL=https://beta.get.gov - GETGOV_PUBLIC_SITE_URL=https://beta.get.gov
# Set a username for accessing the registry # Set a username for accessing the registry

View file

@ -210,6 +210,7 @@ TEMPLATES = [
"registrar.context_processors.language_code", "registrar.context_processors.language_code",
"registrar.context_processors.canonical_path", "registrar.context_processors.canonical_path",
"registrar.context_processors.is_demo_site", "registrar.context_processors.is_demo_site",
"registrar.context_processors.is_production",
], ],
}, },
}, },

View file

@ -4,9 +4,9 @@
<head> <head>
{% if IS_PRODUCTION %} {% if IS_PRODUCTION %}
<!-- Google tag (gtag.js) --> <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PZ5QSP6QPL"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-PZ5QSP6QPL"></script>
<script> <script>
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-PZ5QSP6QPL'); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-PZ5QSP6QPL');
</script> </script>
{% endif %} {% endif %}