I have a few environment variables set up through Heroku to access a GrapheneDB instance. When I use the Heroku CLI command heroku config, all the environmental variables are returned as expected.
For example, "heroku config" returns:
GRAPHENEDB_BOLT_PASSWORD: some_password
GRAPHENEDB_BOLT_URL: bolt://hobby-someletters.dbs.graphenedb.com:24786
GRAPHENEDB_BOLT_USER: appnumbers
GRAPHENEDB_URL: http://appnumbers:some_password@hobby-someletters.dbs.graphenedb.com:24789
NEO4J_REST_URL: GRAPHENEDB_URL
However, when I try to use the os.environ.get() method to access these environment variables, all three print statements return None rather than the desired output that the heroku config returns. This would indicate to me that the Python environment does not have access to the Heroku environment variables. How can I give python access to these?
import os
from py2neo import Graph
graphenedb_url = os.environ.get('GRAPHENEDB_BOLT_URL')
graphenedb_user = os.environ.get("GRAPHENEDB_BOLT_USER")
graphenedb_pass = os.environ.get("GRAPHENEDB_BOLT_PASSWORD")
print(graphenedb_url)
print(graphenedb_user)
print(graphenedb_pass)
I have tried using the solution from Acess Heroku variables from Flask
but when I do the command:
heroku config:pull --overwrite
the CLI returns
config:pull is not a heroku command.