aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/response.py
diff options
context:
space:
mode:
authorJessica Tallon <jessica@megworld.co.uk>2014-09-05 14:13:49 +0100
committerJessica Tallon <jessica@megworld.co.uk>2014-09-05 14:17:42 +0100
commit0af1b859989e6a910360b5ac87c5b7c8dc2e5a91 (patch)
treee76790cc236580c537326887e1fa9801d04ad167 /mediagoblin/tools/response.py
parentf251d99828f30b31d8932f1046101ab332debf75 (diff)
downloadmediagoblin-0af1b859989e6a910360b5ac87c5b7c8dc2e5a91.tar.lz
mediagoblin-0af1b859989e6a910360b5ac87c5b7c8dc2e5a91.tar.xz
mediagoblin-0af1b859989e6a910360b5ac87c5b7c8dc2e5a91.zip
Add XRD+XML formatting for /.well-known/host-meta
Diffstat (limited to 'mediagoblin/tools/response.py')
-rw-r--r--mediagoblin/tools/response.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mediagoblin/tools/response.py b/mediagoblin/tools/response.py
index 57552963..88270265 100644
--- a/mediagoblin/tools/response.py
+++ b/mediagoblin/tools/response.py
@@ -29,11 +29,12 @@ class Response(wz_Response):
default_mimetype = u'text/html'
-def render_to_response(request, template, context, status=200):
+def render_to_response(request, template, context, status=200, mimetype=None):
"""Much like Django's shortcut.render()"""
return Response(
render_template(request, template, context),
- status=status)
+ status=status,
+ mimetype=mimetype)
def render_error(request, status=500, title=_('Oops!'),
err_msg=_('An error occured')):
@@ -164,7 +165,7 @@ def json_error(error_str, status=400, *args, **kwargs):
code to 400.
"""
return json_response({"error": error_str}, status=status, *args, **kwargs)
-
+
def form_response(data, *args, **kwargs):
"""
Responds using application/x-www-form-urlencoded and returns a werkzeug