From 6e23d752f0e3aa2b82c25e572085ad5bf1baffaa Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 10 Oct 2018 21:52:19 +0200 Subject: Use a single parameter for DB connection Could not get pymongo to work otherwise. --- kpov_judge/web/kpov_judge/kpov_judge.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'kpov_judge/web') diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 6e94f05..b832007 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -32,13 +32,7 @@ params_meta = {'neznano_ime_naloge': {'opis':'NEZNANA NALOGA', 'w': False}} @app.before_request def before_request(): - g.db = pymongo.MongoClient(app.config['DB_HOST']).kpov - try: - user = app.config['USERNAME'] - password = app.config['PASSWORD'] - g.db.authenticate(user, password) - except Exception as e: - raise e #no auth or auth config? + g.db = pymongo.MongoClient(app.config['DB_URI']).get_default_database() @app.route('/') -- cgit v1.2.1