Pure Python website engine. Zero dependencies. Real JSX templates.
Project description
Boask
Pure Python website engine.
Zero external dependencies.
pip install boask
Quick Start
from boask import route, use, run_server, html_templates
@route("/")
def home(handler):
return html_templates.render("home.html", title="Boask")
if __name__ == "__main__":
run_server()
Comparison to Flask
- Lightweight.
- No external dependecies.
- Unlike Flask, it's for beginners, and movers from Flask.
- No
{{ url_for('static', filename='css/main.css') }}(example), we use/static/css/main.cssfor example!
Info
- Do not install a earlier version than 1.0.4, you can 1.0.0 but that one is not supported! You can't import them! Also, do not install 1.1.4! It had a bug in strict slashes and it did 500 always! I don't know how the 1.1.4 issue happened! Do not install 1.1.5a2 also! It has import error instead of import .error
Changelog
Right now
New! "app" yeah, like Flask
To use
from boask import Boask
app = Boask()
And to do it with route (yeah, i added app.route()) this example is for HTML templates
from boask import Boask, route, use, run_server, html_templates
app = Boask()
def home(handler):
return html_templates.render("home.html")
Note: Replace home.html with your file name (e.g index.html)
New in authentication! Banning!
Usage:
from auth.ban import Ban
# 'handler' is the instance of your HTTP request handler (from BaseHTTPRequestHandler, for example).
response = Ban.ban_user(handler)
Advanced Auth Added!
Example:
from boask.core import route, use, run_server, Boask
from boask.middleware.advanced_auth import AdvancedAuth
from boask.auth.login import login
from boask.auth.register import register
app = Boask()
auth = AdvancedAuth()
use(auth.middleware)
@route("/register", methods=["POST"])
def do_register(handler):
return register(handler)
@route("/login", methods=["POST"])
def do_login(handler):
return login(handler)
@route("/dashboard", methods=["GET"])
@auth.protected
def dashboard(handler):
return f"Welcome, {handler.user}!"
if __name__ == "__main__":
run_server(port=8080, host="0.0.0.0")
INFO: DO NOT USE 1.1.6 YOU CAN BUT IT HAS A BROKEN README.
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
boask-1.1.8.tar.gz
(9.8 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
boask-1.1.8-py3-none-any.whl
(12.2 kB
view details)
File details
Details for the file boask-1.1.8.tar.gz.
File metadata
- Download URL: boask-1.1.8.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31747d70a86f24326e0dec9bcd623f9c8e2875b3bca86d7ae0bca7a115b1565
|
|
| MD5 |
bc1c767a2d7085b021aac8b4336d4d64
|
|
| BLAKE2b-256 |
0a9c2630386408a0f2526490073ce86e2ab909a32985c835c2192a2965d047f8
|
File details
Details for the file boask-1.1.8-py3-none-any.whl.
File metadata
- Download URL: boask-1.1.8-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07157d1e762077c886127866d53041d258f41ee17d2ba10150c63a1fcbf34327
|
|
| MD5 |
d8f258130c462b465febded563aedbeb
|
|
| BLAKE2b-256 |
0e225c17bd1fed3d2637fa9de1d2bdc9ef23642ea3e0331eaf9ef03eaa9b05f5
|