diff --git a/estela-api/config/settings/base.py b/estela-api/config/settings/base.py index b96f71fc..e7155949 100644 --- a/estela-api/config/settings/base.py +++ b/estela-api/config/settings/base.py @@ -121,6 +121,7 @@ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", diff --git a/estela-api/config/settings/local.py b/estela-api/config/settings/local.py index b1a537f9..69899ba5 100644 --- a/estela-api/config/settings/local.py +++ b/estela-api/config/settings/local.py @@ -1,6 +1,8 @@ +import environ as _environ + from config.settings.base import * # noqa: F401,F403,F405 -DEBUG = True +DEBUG = _environ.Env().bool("DEBUG", default=False) RUN_JOBS_PER_LOT = 100 CHECK_JOB_ERRORS_BATCH_SIZE = 10 diff --git a/estela-api/config/urls.py b/estela-api/config/urls.py index 0506cb5c..023d246e 100644 --- a/estela-api/config/urls.py +++ b/estela-api/config/urls.py @@ -39,5 +39,4 @@ def get(self, request): ] urlpatterns = urlpatterns + django_external_apps_url -if settings.DEBUG: - urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) +urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/estela-api/requirements/base.in b/estela-api/requirements/base.in index 25783f2d..890c204e 100644 --- a/estela-api/requirements/base.in +++ b/estela-api/requirements/base.in @@ -19,4 +19,5 @@ pymongo[srv] pyodbc redis gunicorn +whitenoise git+https://github.com/bitmakerla/estela-queue-adapter.git diff --git a/estela-api/requirements/base.txt b/estela-api/requirements/base.txt index 0c8512fb..fb1b3946 100644 --- a/estela-api/requirements/base.txt +++ b/estela-api/requirements/base.txt @@ -116,6 +116,7 @@ google-resumable-media==2.5.0 googleapis-common-protos==1.60.0 # via google-api-core gunicorn==20.1.0 +whitenoise==6.7.0 # via -r base.in idna==2.10 # via requests diff --git a/estela-api/requirements/test.txt b/estela-api/requirements/test.txt index 4a55859e..947f53d6 100644 --- a/estela-api/requirements/test.txt +++ b/estela-api/requirements/test.txt @@ -165,6 +165,7 @@ googleapis-common-protos==1.60.0 # -r base.txt # google-api-core gunicorn==20.1.0 +whitenoise==6.7.0 # via -r base.txt idna==2.10 # via