Conversation
|
The review app is available at this URL: |
68f4f15 to
5c56c99
Compare
| "static": static, | ||
| "url": reverse, | ||
| "inflector": inflector, | ||
| "DJANGO_ENV": settings.DJANGO_ENV, |
There was a problem hiding this comment.
Tried using ENV_CONFIG instead of DJANGO_ENV, but ENV_CONFIG did not appear to be being set.
"ENV_CONFIG": os.environ.get("ENV_CONFIG", "unknown"),
There was a problem hiding this comment.
What's ENV_CONFIG?
I think you still need to pass IS_PRODUCTION into this globals list for it to be picked up in the template?
There was a problem hiding this comment.
What's ENV_CONFIG?
ENV_CONFIG, and ENVIRONMENT, are both variables I could see in the various variables.sh files. They have values like dev, review, preprod and prod. Before trying DJANGO_ENV, I did try using ENV_CONFIG to determine the environment being used but it did not seem to be available in the application, not just in local development but also in the review app. Therefore I used DJANGO_ENV instead. I've since noticed that we're using DJANGO_ENV elsewhere in the app to determine the environment, so think that is appropriate to use for this.
Example variables.sh containing ENV_CONFIG, and ENVIRONMENT https://github.com/NHSDigital/dtos-manage-breast-screening/blob/main/infrastructure/environments/prod/variables.sh
I think you still need to pass IS_PRODUCTION into this globals list for it to be picked up in the template?
Yes, you're correct. I had made that change locally but forgot to push. Sorry. Now corrected. Thank you.
| {% block pageTitle %}{% if form and form.errors %}Error: {% endif %}{% if page_title %}{{ page_title }} – {% endif %}Manage breast screening – NHS{% endblock %} | ||
|
|
||
| {% block header %} | ||
| {% if DJANGO_ENV != 'prod' %} |
There was a problem hiding this comment.
This contradicts other code that does DJANGO_ENV = environ.get("DJANGO_ENV", "production") i.e. production instead of prod
I'm not sure what it's actually set to in practice.
Can we add an IS_PRODUCTION var to settings.py to ensure consistency?
There was a problem hiding this comment.
Added IS_PRODUCTION to base.py. Use that instead of checking if DJANGO_ENV is production.
5c56c99 to
033e32c
Compare
033e32c to
deb02e4
Compare
Uses DJANGO_ENV to determine environment name
deb02e4 to
ba353c9
Compare
|



Description
Add environment banner to top of page. Using
DJANGO_ENVto determine environment.Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12497