aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/run.py
diff options
context:
space:
mode:
author0livd <github@destras.fr>2018-01-25 17:41:28 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2018-01-25 17:41:28 +0100
commitb93ea4830d5290def99d597f17292a8aa5d4c090 (patch)
treebeb34a47d9eb85643672cc3b743c9b6d37932092 /ihatemoney/run.py
parent830718e1fe5f18959f455a696ebc2172a2d5f253 (diff)
downloadihatemoney-mirror-b93ea4830d5290def99d597f17292a8aa5d4c090.zip
ihatemoney-mirror-b93ea4830d5290def99d597f17292a8aa5d4c090.tar.gz
ihatemoney-mirror-b93ea4830d5290def99d597f17292a8aa5d4c090.tar.bz2
API: Migrate from flask-rest to flask-restful (#315)
The flask-rest custom json encoder is still needed and thus was added to ihatemoney's utils. Closes #298
Diffstat (limited to 'ihatemoney/run.py')
-rw-r--r--ihatemoney/run.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ihatemoney/run.py b/ihatemoney/run.py
index e3a7c1e..a8de26f 100644
--- a/ihatemoney/run.py
+++ b/ihatemoney/run.py
@@ -11,7 +11,7 @@ from werkzeug.contrib.fixers import ProxyFix
from ihatemoney.api import api
from ihatemoney.models import db
-from ihatemoney.utils import PrefixedWSGI, minimal_round
+from ihatemoney.utils import PrefixedWSGI, minimal_round, IhmJSONEncoder
from ihatemoney.web import main as web_interface
from ihatemoney import default_settings
@@ -68,6 +68,8 @@ def load_configuration(app, configuration=None):
app.config.from_pyfile(env_var_config)
else:
app.config.from_pyfile('ihatemoney.cfg', silent=True)
+ # Configure custom JSONEncoder used by the API
+ app.config['RESTFUL_JSON'] = {'cls': IhmJSONEncoder}
def validate_configuration(app):