Plain is headed towards 1.0! Subscribe for development updates →

Plain

Plain is a web framework for building products with Python.

With the core plain package you can build an app that:

With the official Plain ecosystem packages you can:

Learn more at plainframework.com.

 1from pprint import pformat
 2
 3from markupsafe import escape
 4
 5from plain.http import Response
 6from plain.views.exceptions import ResponseException
 7
 8
 9def dd(obj):
10    """
11    Dump and die.
12
13    Dump the object and raise a ResponseException with the dump as the response content.
14    """
15    dump_str = pformat(obj)
16
17    print(f"Dumping object:\n{dump_str}")
18
19    response = Response()
20    response.status_code = 500
21    response.content = escape(dump_str)
22    response.content_type = "text/html"
23    raise ResponseException(response)