Skip to content

Commit

Permalink
Merge pull request #67 from uktrade/fix/env_key
Browse files Browse the repository at this point in the history
Adding context processor for variables
  • Loading branch information
simonstrong-dbt authored Aug 21, 2024
2 parents 4c9c823 + cddfc86 commit b18d9a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions django_app/redbox_app/redbox_core/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.conf import settings
import environ

env = environ.Env()

def analytics_tag(request):
return {
'analytics_tag': env.str("ANALYTICS_TAG")
}

def analytics_link(request):
return {
'analytics_link': env.str("ANALYTICS_LINK")
}
2 changes: 2 additions & 0 deletions django_app/redbox_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"redbox_app.redbox_core.context_processors.analytics_tag"
"redbox_app.redbox_core.context_processors.analytics_link"
],
},
},
Expand Down

0 comments on commit b18d9a1

Please sign in to comment.