Skip to content

Commit

Permalink
added dotenv code
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhrajitPrusty committed Oct 24, 2018
1 parent b519f04 commit 9aca99a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import os
from gevent.pywsgi import WSGIServer
from pymongo import MongoClient
from dotenv import load_dotenv

load_dotenv()

def getContent():
dburl = os.environ['MONGODB_URI']
dburl = os.environ.get('MONGODB_URI')

client = MongoClient(dburl)

Expand Down
4 changes: 3 additions & 1 deletion update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
from pymongo import MongoClient
from userdata import Member
import re
from dotenv import load_dotenv

dburl = os.environ["MONGODB_URI"]
load_dotenv()
dburl = os.environ.get("MONGODB_URI")

client = MongoClient(dburl)

Expand Down

0 comments on commit 9aca99a

Please sign in to comment.