Skip to content

Instantly share code, notes, and snippets.

@chrysmur
Last active March 5, 2020 08:40
Show Gist options
  • Save chrysmur/8e6cb377ae6db3b9519761df82369588 to your computer and use it in GitHub Desktop.
Save chrysmur/8e6cb377ae6db3b9519761df82369588 to your computer and use it in GitHub Desktop.
import os
def env_var(name):
try:
return str(os.environ[name])
except:
raise KeyError
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'employees',
'USER': 'root',
'PASSWORD':env_var('DB_PASS'),
'HOST':'0.0.0.0',
'PORT':''
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment