4👍
✅
You can set local env vars by adding them to a .env
file, and then starting your development server via heroku local
. This will convert all NAME=value
lines from .env
to env vars and make then available to your app. You can then add .env
to your .gitignore
, as this is only required on your local machine. See https://devcenter.heroku.com/articles/heroku-local#set-up-your-local-environment-variables for more details.
3👍
You can set an environment variable with Heroku’s command line tool like this:
heroku config:set SECRET_KEY='Your secret key'
Source:stackexchange.com