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?

  1. create python file in root of project.
  2. paste inside

    #! /usr/bin/env bash export $(cat /vagrant/.env | grep -v ^# | xargs)  /home/vagrant/.virtualenvs/virtualenvname/bin/python "$@" 
  3. make executable chmod +x python

  4. 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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -