Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mojito_web-0.1.0a6.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

mojito_web-0.1.0a6-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file mojito_web-0.1.0a6.tar.gz.

File metadata

  • Download URL: mojito_web-0.1.0a6.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for mojito_web-0.1.0a6.tar.gz
Algorithm Hash digest
SHA256 1cbe84a731ff3873a0f9a9a9ad57033b6eef2f5166ae3c2c44fe914bc974ad88
MD5 5dd9e7e02a30e9117bbd07147dc1a587
BLAKE2b-256 0253a89c7fc0815ae4eda88b0d16d20cbfbbd62b7dbb5b502c7f23274193b30e

See more details on using hashes here.

File details

Details for the file mojito_web-0.1.0a6-py3-none-any.whl.

File metadata

  • Download URL: mojito_web-0.1.0a6-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for mojito_web-0.1.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 20393cb38bdc03615308e1f7948d351c7a37ef891303583903507c022e3ef75a
MD5 90449d06f0ca6c9598bad062e33522b1
BLAKE2b-256 b9f9c8f676d5fb3d7b161a8f4b3ac0616f3ede159b853624d1f8e62deb12d189

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page