EZTea Web Framework
Project description
EZTea Web Framework
# use falcon
pip install eztea[falcon,mysql,migration,testing]
# use django
pip install eztea[django,postgresql,testing]
Usage
Falcon Example
from validr import T
from eztea.falcon import Application, ResponderContext, Router
router = Router()
@router.get("/")
def hello(
ctx: ResponderContext,
name: str = T.str.default("world"),
) -> T.dict(hello=T.str):
return {"hello": name}
app = Application()
app.include_router(router)
Django Example
from validr import T
from django.http import HttpRequest
from eztea.django import Router
router = Router()
@router.get("/")
def hello(
req: HttpRequest,
name: str = T.str.default("world"),
) -> T.dict(hello=T.str):
return {"hello": name}
urls = router.to_url_s()
Testing Example
from eztea.falcon.testing import WebTestClient
from eztea.django.testing import WebTestClient
from myapp.wsgi import application
def test_hello():
client = WebTestClient(application)
response = client.get('/')
assert response.status_code == 200
assert reesponse.json() == {"hello": "world"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eztea-0.1.12.tar.gz
(20.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
eztea-0.1.12-py3-none-any.whl
(28.1 kB
view details)
File details
Details for the file eztea-0.1.12.tar.gz.
File metadata
- Download URL: eztea-0.1.12.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b19db4e8209eca0f5306c0867acc71600c9fe08a8541f8823634238cda10dbe
|
|
| MD5 |
902bd56e585a2b404d1c467996d20b63
|
|
| BLAKE2b-256 |
2d7fe4ed06c7ffb88a99470277e82c40e27dd3fd10235bda0ab9f76c41f9d9b6
|
File details
Details for the file eztea-0.1.12-py3-none-any.whl.
File metadata
- Download URL: eztea-0.1.12-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906c88f7d61acc222c49fea8e53cd4197ff11cb74d35aa0fb3efdf59b38fe5ba
|
|
| MD5 |
2018ad2c4b1c27685d146ac57702cb77
|
|
| BLAKE2b-256 |
822551bfa1a3eb65a49864704b4eea9937cca6f20fd6c2b315cb1d2fa2715a3e
|