diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-10 21:52:19 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-10 23:45:21 +0200 |
commit | 6e23d752f0e3aa2b82c25e572085ad5bf1baffaa (patch) | |
tree | 8fd653bbebdb9c9d1199e503b5939d495f106325 /kpov_judge/web | |
parent | fbaf605807b821b74c3361abe2c14f8143023b05 (diff) |
Use a single parameter for DB connection
Could not get pymongo to work otherwise.
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 8 |
1 files changed, 1 insertions, 7 deletions
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('/') |