Add global setting

This commit is contained in:
zandercymatics 2023-11-03 09:37:10 -06:00
parent 42c1f8ebc5
commit 6e34d231f3
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 15 additions and 2 deletions

View file

@ -23,6 +23,9 @@ applications:
DJANGO_LOG_LEVEL: INFO
# default public site location
GETGOV_PUBLIC_SITE_URL: https://beta.get.gov
# NOTE: This needs to go in manifest-staging
# This is here for PR purposes only!
IS_PRODUCTION: True
routes:
- route: getgov-za.app.cloud.gov
services:

View file

@ -46,6 +46,7 @@ path = Path(__file__)
env_db_url = env.dj_db_url("DATABASE_URL")
env_debug = env.bool("DJANGO_DEBUG", default=False)
env_is_production = env.bool("IS_PRODUCTION", default=False)
env_log_level = env.str("DJANGO_LOG_LEVEL", "DEBUG")
env_base_url = env.str("DJANGO_BASE_URL")
env_getgov_public_site_url = env.str("GETGOV_PUBLIC_SITE_URL", "")
@ -72,6 +73,8 @@ BASE_DIR = path.resolve().parent.parent.parent
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env_debug
# Controls production specific feature toggles
IS_PRODUCTION = env_is_production
# Applications are modular pieces of code.
# They are provided by Django, by third-parties, or by yourself.

View file

@ -13,6 +13,7 @@
<h1>Manage your domains</h2>
<p class="margin-top-4">
{% if is_production %}
<a href="{% url 'application:' %}"
class="usa-button usa-tooltip disabled-link"
data-position="right"
@ -20,6 +21,11 @@
>
Start a new domain request
</a>
{% else %}
<a href="{% url 'application:' %}" class="usa-button">
Start a new domain request
</a>
{% endif %}
</p>
<section class="section--outlined tablet:grid-col-11 desktop:grid-col-10">
@ -134,7 +140,7 @@
{% endif %}
</section>
{# Note: Reimplement this after MVP.. #}
{# Note: Reimplement this after MVP #}
<!--
<section class="section--outlined tablet:grid-col-11 desktop:grid-col-10">
<h2>Archived domains</h2>

View file

@ -2,7 +2,7 @@ from django.db.models import F
from django.shortcuts import render
from registrar.models import DomainApplication
from django.conf import settings
def index(request):
"""This page is available to anyone without logging in."""
@ -22,4 +22,5 @@ def index(request):
state=F("domain__state"),
)
context["domains"] = domains
context["is_production"] = settings.IS_PRODUCTION
return render(request, "home.html", context)