Skip to content

Instantly share code, notes, and snippets.

@moeinserpico
Created September 30, 2019 05:48
Show Gist options
  • Save moeinserpico/8c19cc9f53404eb71a068e48d4aabb2e to your computer and use it in GitHub Desktop.
Save moeinserpico/8c19cc9f53404eb71a068e48d4aabb2e to your computer and use it in GitHub Desktop.
.یرایش Seeting جنگو
import os
def env_var(name):
'''gets the environment variables'''
try:
return str(os.environ[name])
except:
raise KeyError
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