From c6d84f6a707fd308622638539de88039b8efe45e Mon Sep 17 00:00:00 2001 From: Luigi Bertaco Cristofolini Date: Tue, 12 Oct 2021 04:52:10 +1100 Subject: [PATCH] fix: use django-environ for django DEBUG settings (#6792) ## Description Django examples use `django-environ` but it is not being used for the `DEBUG` settings. ## Checklist - [x] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md) - [x] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#readme-file) - [x] **Tests** pass: `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup)) - [x] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [x] Please **merge** this PR for me once it is approved. - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/CODEOWNERS) with the codeowners for this sample --- appengine/flexible/django_cloudsql/mysite/settings.py | 2 +- appengine/standard_python3/django/mysite/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appengine/flexible/django_cloudsql/mysite/settings.py b/appengine/flexible/django_cloudsql/mysite/settings.py index 9dbf65fc2a15..5c7890836f83 100644 --- a/appengine/flexible/django_cloudsql/mysite/settings.py +++ b/appengine/flexible/django_cloudsql/mysite/settings.py @@ -58,7 +58,7 @@ # SECURITY WARNING: don't run with debug turned on in production! # Change this to "False" when you are ready for production -DEBUG = True +DEBUG = env("DEBUG") # SECURITY WARNING: App Engine's security features ensure that it is safe to # have ALLOWED_HOSTS = ['*'] when the app is deployed. If you deploy a Django diff --git a/appengine/standard_python3/django/mysite/settings.py b/appengine/standard_python3/django/mysite/settings.py index 9dce2ce49676..2e3a523b736e 100644 --- a/appengine/standard_python3/django/mysite/settings.py +++ b/appengine/standard_python3/django/mysite/settings.py @@ -57,7 +57,7 @@ # SECURITY WARNING: don't run with debug turned on in production! # Change this to "False" when you are ready for production -DEBUG = True +DEBUG = env("DEBUG") # SECURITY WARNING: App Engine's security features ensure that it is safe to # have ALLOWED_HOSTS = ['*'] when the app is deployed. If you deploy a Django