python - How to get PyCharm runserver to work with vagrant and heroku run? -
normally execute heroku run
set environment variables .env
file. can't prefix pycharm's command heroku run
. how set environment variables?
- create
python
file in root of project. paste inside
#! /usr/bin/env bash export $(cat /vagrant/.env | grep -v ^# | xargs) /home/vagrant/.virtualenvs/virtualenvname/bin/python "$@"
make executable
chmod +x python
- in pycharm set file python interpreter project.
n.b. needs variables in .env seperated using equals sign , there no spaces.
eg.
django_secret_key=abc123abc124 django_settings_module=myproject.settings.local
Comments
Post a Comment