Beautiful debugging page for Starlette apps.
Project description
Starception
Beautiful debugging page for Starlette apps. Look and feel inspired by Elixir Phoenix.
Installation
Install starception
using PIP or poetry:
pip install starception
# or
poetry add starception
Add it as the first middleware in to your app:
app = Starlette(
middleware=[
Middleware(StarceptionMiddleware, debug=True),
# other middleware here
],
)
Note, the middleware won't handle anything if debug=False
,
instead it will display plain string "Internal Server Error".
Also, I would recommend to add it only for local development, as such error page,
when enabled on prod by mistake, can expose sensitive data.
Screenshot
Features
- secrets masking
- solution hints
- code snippets
- display request info: query, body, headers, cookies
- session contents
- request and app state
- platform information
- environment variables
The middleware will automatically mask any value which key contains key
, secret
, token
, password
.
Quick start
See example application in examples/
directory of this repository.
Solution hints
If exception class has solution
attribute then its content will be used as a solution hint.
class WithHintError(Exception):
solution = (
'The connection to the database cannot be established. '
'Either the database server is down or connection credentials are invalid.'
)
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
Built Distribution
File details
Details for the file starception-0.1.0.tar.gz
.
File metadata
- Download URL: starception-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0987650e7d0494381c02b1370929d4c51451deb0b74d664cf11800518cf29c04 |
|
MD5 | 8310c40748f01a795f2637140df60279 |
|
BLAKE2b-256 | 628e4df2f98d22c7a6a21243d2d9c27bd9cbd2707c59a197e91e934b8026d23f |
File details
Details for the file starception-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: starception-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86dba96e86f659dd3d52a1fc0541df43c4a868516d5585c1389509af63d61a13 |
|
MD5 | 401c1c91d6d6f514084ddbd6635fae98 |
|
BLAKE2b-256 | 2d6d03a5585ad392e37057b6964e08141391d45edccd4c353b4320cfbc84bc9d |