Jinja for Naja Atra
This is a Jinja extension for Naja Atra
Installation
python3 -m pip install naja_atra_jinja
Usage
from naja_atra import route, server
from naja_atra_jinja import JinjaView
@route("/index")
def index(name: str = "world"):
return JinjaView("index.html", {"name": name})
def main():
server.start(port=9090)
if __name__ == "__main__":
main()
For the above code, the templates should be placed in the templates folder in your project's root.
|--templates
|----index.html
|----page.html
|--main.py
You can set your own Jinja2 Environment via set_env function:
from naja_atra import route, server
from naja_atra_jinja import JinjaView, set_env
from jinja2 import Environment, FileSystemLoader
@route("/index")
def index(name: str = "world"):
return JinjaView("index.html", {"name": name})
def main():
env = Environment(loader=FileSystemLoader("/you/own/template/folder"))
set_env(env)
server.start(port=9090)
if __name__ == "__main__":
main()
Metadata
Release files for naja-atra-jinja 1.0.2
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-jinja-1.0.2.tar.gz | 3.4 kB | Without provenance | Details for naja-atra-jinja-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| naja_atra_jinja-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for naja_atra_jinja-1.0.2-py3-none-any.whl |
Total release size: 8.2 kB
Release files / naja-atra-jinja-1.0.2.tar.gz
| Download URL | naja-atra-jinja-1.0.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7c770f7d93bce494b446c51c9e560fd3a44aeca3492dd598293dd409ea05a63
|
|
BLAKE2b-256 checksum How to use checksums |
e6b854dbd9135785d994e4c7a8b5c2c6be7ae6cfbfe148442c9b8fceb6d18d34
|
| 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_jinja-1.0.2-py3-none-any.whl
| Download URL | naja_atra_jinja-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
929784217f457c8eae0c95b12431d8bd0d21f4be4a3c19c68df59dadeb7d1ccc
|
|
BLAKE2b-256 checksum How to use checksums |
b55ebabede6fa188f8fef61d9d5584e27eaa742e7c4f0f7f2fa6757a2767ab8a
|
| 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-jinja 1.0.2
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.