Naja Atra ASGI
This ia a ASGI proxy that proxies requests to Naja Atra.
Usage
Take uvicorn as an example.
import uvicorn
There is a legacy application
from naja_atra import route
from naja_atra_asgi import app
@route("/hello")
def hello(name: str):
return {"messag": f"Hello, {name}!"}
if __name__ == '__main__':
uvicon_conf = uvicorn.Config(
app, host="0.0.0.0", port=9090, log_level="info")
asgi_server = uvicorn.Server(uvicon_conf)
asgi_server.run()
You can use server.scan() to import routes from other modules. And also you can use naja_atra_asgi.config() to function to sepecify the static resources routes.
import os
import uvicorn
import naja_atra.server as server
from naja_atra import route
from naja_atra_asgi import config, app
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
server.scan(base_dir="tests/ctrls", regx=r'.*controllers.*',
project_dir=PROJECT_ROOT)
config(
resources={"/public/*": f"{PROJECT_ROOT}/tests/static",
"/*": f"{PROJECT_ROOT}/tests/static"})
uvicon_conf = uvicorn.Config(
app, host="0.0.0.0", port=9090, log_level="info")
asgi_server = uvicorn.Server(uvicon_conf)
asgi_server.run()
Legacy Applications
You can use the legacy ASGI (V2) application function app_v2 if your server does not support ASGI V3.
Metadata
Release files for naja-atra-asgi 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| naja-atra-asgi-1.0.1.tar.gz | 7.2 kB | Without provenance | Details for naja-atra-asgi-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| naja_atra_asgi-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for naja_atra_asgi-1.0.1-py3-none-any.whl |
Total release size: 15.9 kB
Release files / naja-atra-asgi-1.0.1.tar.gz
| Download URL | naja-atra-asgi-1.0.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fc11343d020cfe01f4a3caa205c108af6db429bfb725e73dd520dd770140c64
|
|
BLAKE2b-256 checksum How to use checksums |
db5d3b935a4f290d61474bfe1f18282f88a80ad2392cf8188d499368a7b3f22f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / naja_atra_asgi-1.0.1-py3-none-any.whl
| Download URL | naja_atra_asgi-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ad449fea2669d017f5a2c4e31f5da96e683ca43cb516258b46847e5b46c1122
|
|
BLAKE2b-256 checksum How to use checksums |
d0178d9b6ea05602acb2240c5e5bcb32aaa26441643ae58d38ae74d78b7d272d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for naja-atra-asgi 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.