Lightweight ASGI framework based on Starlette.
Project description
Mojito
ASGI Python web framework.
Based on Starlette and Jinja2 templates, Mojito is an async python web framework meant to resemble the same ease of use as Flask but built with an ASGI implementation.
Mojito is Starlette underneath and provides a thin layer on top to make dealing with app management easier, providing ease-of-life defaults, and adding a few handy tools like g, the global context variable similar to Flask's g.
Provided handy bits:
- g: Global context variable
- Message flashing: built off of g and cookies. Provides a way of displaying messages the same way as Flask during the session.
Route functions
Routes are created primarily by decorating a function with @AppRouter.route()
.
Each function must take the Request as the first parameter.
The default response type of routes is HTMLResponse.
Handy bits
g: GlobalContextVar
Global context variable similar to g in Flask. Scoped to the request lifecycle it can be used anywhere throughout the application and will be unique to each request.
Usage
g.foo = 'foood'
print(g.foo) -> 'foood'
Message flashing
Provides message flashing like Flask with methods flash_message()
and get_flashed_messages()
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 mojito_web-0.1.0b1.tar.gz
.
File metadata
- Download URL: mojito_web-0.1.0b1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.18.1 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1db9de94afc216a8effa2ceba5d33841f48eb5e1e4bcc81dcce7f177e906910 |
|
MD5 | 8b715df4f95ce52d88bdf88c49bd7a17 |
|
BLAKE2b-256 | f42c57108e8a5f659e6c0a45967fd8e246fdd53342eef92432082d27e06b3044 |
File details
Details for the file mojito_web-0.1.0b1-py3-none-any.whl
.
File metadata
- Download URL: mojito_web-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.18.1 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5635c0d5c7f52f870e52d98df7f221c8de2f41e8a08319e332d63f9345f0455e |
|
MD5 | c07db2cd278e85efa9959fa7c544e9d8 |
|
BLAKE2b-256 | 04550d41a4791891c687913ccb7f78864a1299a6a31002f8e7adc0c898c9eb87 |