Releases: takos22/baguette
baguette 0.3.1
baguette 0.3.1
Changelog
- Add json encoders in baguette.json
- Add setters in Request
- Add properties in Responses
- Update and add docs
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.3
baguette 0.3
Changelog
- Add middleware support
- Add Config class
- Customizable JSON encoder for JSON responses
- Update and add docs
Example of how to use middlewares
import time
from baguette import Baguette, Middleware
app = Baguette()
@app.middleware()
class TimingMiddleware(Middleware):
async def __call__(self, request: Request):
start_time = time.perf_counter()
response = await self.next(request)
print(
"{0.method} {0.path} took {1} seconds to be handled".format(
request, time.perf_counter() - start_time
)
)
return response
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.2.1
baguette 0.2.1
Changelog
- Accept bytes as handler return value
- Add many docs
Example of the new feature
from baguette import Baguette
app = Baguette()
@app.route("/")
async def index():
return b"<h1>Hello, World!</h1>"
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.2.0
baguette 0.2.0
- Add HTML rendering
- Add redirects
Example code
main.py
from baguette import Baguette, redirect, render
app = Baguette()
@app.route("/")
async def index():
return redirect("/home")
@app.route("/home")
async def home(request):
user = ... # do some user handling, lets assume user has a name attribute
return render("home.html", username=user.name)
templates/home.html
:
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello {{ username }}!</h1>
</body>
</html>
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.1.6
baguette 0.1.6
Fix bug in await request.form(include_querystring=True)
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.1.5
baguette 0.1.5
Add request.form, with support for application/x-www-form-urlencoded
and multipart/form-data
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.1.4
baguette 0.1.4
Add static file serving and FileResponse
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.1.3
Fix bug #2
baguette 0.1.2
baguette 0.1.2
Add app.run(), see https://baguette.readthedocs.io/en/latest/api.html#baguette.Baguette.run
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6
baguette 0.1.1
baguette 0.1.1
Fix dynamic routing error and add a test for it
Links
PyPi: https://pypi.org/project/baguette/
Docs: https://baguette.readthedocs.io/
Discord support server: https://discord.gg/PGC3eAznJ6