How to set environment variables in heroku-django project?

你。 提交于 2020-01-13 05:54:09

问题


I have this code in my settings.py..

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')

I tried setting environment variable using this in heroku bash

export EMAIL_HOST_USER=xxx

and also

heroku config:set EMAIL_HOST_USER=xxx

None of the both method worked for me. How can i set environment variable in heroku?


回答1:


okk.. found the answer!!

instead of

heroku config:set EMAIL_HOST_USER=xxx

writing

heroku config:add EMAIL_HOST_USER=xxx

solves problem..



来源:https://stackoverflow.com/questions/34990128/how-to-set-environment-variables-in-heroku-django-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!