diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-15 14:10:20 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-15 14:10:20 +0100 |
commit | 04326801570d17918a48a9a64b164ea9464f3562 (patch) | |
tree | 12e0c7cdc84c8132cd475ae799acc8141a525e8c /config | |
parent | 7993028f58b9aa736fda342284c9ee2c913d3658 (diff) |
added ability to set LOCAL_CLOUD_PROXY environment variable
Diffstat (limited to 'config')
-rw-r--r-- | config/settings/gcloud_settings.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/config/settings/gcloud_settings.py b/config/settings/gcloud_settings.py index 8bb7574..3a8912f 100644 --- a/config/settings/gcloud_settings.py +++ b/config/settings/gcloud_settings.py @@ -199,6 +199,20 @@ if os.getenv('GAE_APPLICATION', None): 'NAME': 'ctrack', } } +elif os.getenv("LOCAL_CLOUD_PROXY", None): + # Running Cloud Proxy Locally. Make sure it's running separately. + # This allows for us to drop and create the database, update migrations, etc. + # Normal development happens with SQLite as described below. + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'HOST': '127.0.0.1', + 'USER': 'ctrack', + 'PORT': '3306', + 'PASSWORD': os.getenv('DATABASE_PASSWORD'), + 'NAME': 'ctrack', + } + } else: # Running locally so connect to either a local MySQL instance or connect to # Cloud SQL via the proxy. To start the proxy via command line: |