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.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 | |
|---|---|---|---|
| tjamgo-0.1.2.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tjamgo-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / tjamgo-0.1.2.tar.gz
| Download URL | tjamgo-0.1.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4017f3fafb9ad1edbcfe3e4d6ca7daa7c544bccd5afb6d6243e059368538de31
|
|
BLAKE2b-256 checksum How to use checksums |
4ad1e0ae69f8e352423fcc3d615a075ddf5d655aa5d75d6e764fecef14c2d817
|
| 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.2-py2.py3-none-any.whl
| Download URL | tjamgo-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
62bdf5b0597c16026f7574fa26cb6db118d1293db40026954683e7064d7002ef
|
|
BLAKE2b-256 checksum How to use checksums |
0d0cbad9298e44f93258640038af774f2da01737b3750894afbcc7d8c3c18306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|