mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-05 18:34:52 +00:00
Render server errors with a nicer template
This commit is contained in:
@ -57,6 +57,13 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
|
||||
def template_to_string(templatename, attrs = {}):
|
||||
return get_template(templatename).render(Context(attrs))
|
||||
|
||||
def HttpServerError(msg):
|
||||
r = render_to_response('errors/500.html', {
|
||||
'message': msg,
|
||||
})
|
||||
r.status_code = 500
|
||||
return r
|
||||
|
||||
|
||||
class PgXmlHelper(django.utils.xmlutils.SimplerXMLGenerator):
|
||||
def __init__(self, outstream, skipempty=False):
|
||||
|
Reference in New Issue
Block a user