Created
June 17, 2020 05:29
Revisions
-
velotiotech created this gist
Jun 17, 2020 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Set DEBUG flag using Consul KV store index, data = consul_client.kv.get('web/debug') DEBUG = data.get('Value', True) # Set ALLOWED_HOSTS dynamically using Consul KV store ALLOWED_HOSTS = [] index, hosts = consul_client.kv.get('web/allowed_hosts') ALLOWED_HOSTS.append(hosts.get('Value')) # Set INSTALLED_APPS dynamically using Consul KV store INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] index, apps = consul_client.kv.get('web/installed_apps') INSTALLED_APPS += (bytes(apps.get('Value')).decode('utf-8'),)