No recent searches
Popular Articles
Sorry! nothing found for
Posted about 4 years ago by Tadej Svetina
In my settings.py file I use an environmental variable, like this:
MONGO_URI = os.environ['MONGO_URI']
However, when I deploy the project I get an error about this key (MONGO_URI) not existing.
I know I can set this key in Scapringhub settings, but I have to comment the line out for the deploy to work. Is there any way around this?
0 Votes
1 Comments
Tadej Svetina posted about 4 years ago
Found the solution: just do
MONGO_URI = os.environ.get('MONGO_URI')
This way there will be no error due to missing variable
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
In my settings.py file I use an environmental variable, like this:
However, when I deploy the project I get an error about this key (MONGO_URI) not existing.
I know I can set this key in Scapringhub settings, but I have to comment the line out for the deploy to work. Is there any way around this?
0 Votes
1 Comments
Tadej Svetina posted about 4 years ago
Found the solution: just do
This way there will be no error due to missing variable
0 Votes
Login to post a comment