Tjamgo: Python Web Framework built for learning purpose
Tjamgo is a python web framework built for learning.
It's a WSGI framework and can be used with any WSGI application server such as Gunicorn.
Installation
pip install tjamgo
How to use it
Basic usage:
from tjamgo.app import TjamgoApp
app = TjamgoApp()
@app.route("/home", allowed_methods=["get"])
def home(request, response):
response.text = "Hello from the home page"
@app.route("/about", allowed_methods=["put"])
def about(request, response):
response.text = "Hello from the about page"
@app.route("/hello/{name}")
def greeting(request, response, name):
response.text = f"Hello {name}"
@app.route("/books")
class Books:
def get(self, request, response):
response.text = "Books page"
def post(self, request, response):
response.text = "Endpoint to create a book"
def new_handler(req, resp):
resp.text = "From new handler"
app.add_route("/new-handler", new_handler)
@app.route("/template")
def template_handler(req, resp):
resp.body = app.template(
"home.html",
context={"new_title": "tjamgo", "new_body": "Best framework"}
)
Metadata
Release files for tjamgo 0.1.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 | |
|---|---|---|---|
| tjamgo-0.1.1.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tjamgo-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / tjamgo-0.1.1.tar.gz
| Download URL | tjamgo-0.1.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8455ced2995bc008aff8fc76d63931d9821ed9fdcd6aea1daa2886cc5fce7ab0
|
|
BLAKE2b-256 checksum How to use checksums |
e250c811b43c472310452c9a031fc959c8e40e67d4db0e148dd4c7f09ab96de9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / tjamgo-0.1.1-py2.py3-none-any.whl
| Download URL | tjamgo-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 1.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
11c44644a63a245c6bba456b917848066df63ea5af4bf88750b885a32d6064b8
|
|
BLAKE2b-256 checksum How to use checksums |
49da1d3265c098618a08aaa6d47de9f81538ef1537132c5dfe45aec898435b51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|