MarkII is an improved development-mode error handler for Python web applications.
Project description
# markii
MarkII is an improved development-mode error handler for Python web
applications. Currently the only supported framework is `webapp2`.
## Installation
`$ pip install markii`
## Usage
```python
import webapp2
from functools import partial
from markii.frameworks.webapp2 import handle_error
from paste import httpserver
class Handler(webapp2.RequestHandler):
def get(self, n):
self.response.write(str(int(n)))
app = webapp2.WSGIApplication([
webapp2.Route(r"/<n:.*>", handler=Handler)
], debug=True)
app.error_handlers[400] = partial(handle_error, code=400)
app.error_handlers[404] = partial(handle_error, code=404)
app.error_handlers[500] = partial(handle_error, code=500)
httpserver.serve(app, host="127.0.0.1", port="8080")
```
## Screenshot
![Screenshot](/example/screenshot.png)
## Warning
Make sure you only use MarkII in development mode.
## Gotchas
On AppEngine, you must call `markii.appengine.fix_appengine()` inside
your error handler.
## Acknowledgements
MarkII borrows its ideas (and most of its look) from [better_errors](https://github.com/charliesome/better_errors).
MarkII is an improved development-mode error handler for Python web
applications. Currently the only supported framework is `webapp2`.
## Installation
`$ pip install markii`
## Usage
```python
import webapp2
from functools import partial
from markii.frameworks.webapp2 import handle_error
from paste import httpserver
class Handler(webapp2.RequestHandler):
def get(self, n):
self.response.write(str(int(n)))
app = webapp2.WSGIApplication([
webapp2.Route(r"/<n:.*>", handler=Handler)
], debug=True)
app.error_handlers[400] = partial(handle_error, code=400)
app.error_handlers[404] = partial(handle_error, code=404)
app.error_handlers[500] = partial(handle_error, code=500)
httpserver.serve(app, host="127.0.0.1", port="8080")
```
## Screenshot
![Screenshot](/example/screenshot.png)
## Warning
Make sure you only use MarkII in development mode.
## Gotchas
On AppEngine, you must call `markii.appengine.fix_appengine()` inside
your error handler.
## Acknowledgements
MarkII borrows its ideas (and most of its look) from [better_errors](https://github.com/charliesome/better_errors).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
markii-0.2.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for markii-0.2.0.macosx-10.10-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | afce920fed8f48f8ab17fff2d400f5745be63e459cf7eb0ea22b1a82c96a4bde |
|
MD5 | 4c0d245a79e78b25f5565638939effa5 |
|
BLAKE2b-256 | 37845bbf5d0c9e71dbd76e9f00c2c001e501b7014135dfd00d530951acd150c0 |