Flaxon Cheatsheet
Application
from flaxon import Flaxon
app = Flaxon("my-app", debug=True)
@app.get("/")
async def home(): return {"ok": True}
flaxon run app:app --reloadRouting
@app.get("/users/<int:user_id>")
async def user(user_id): return {"id": user_id}
api = Router(prefix="/api")
app.include_router(api, prefix="/v1")Built-ins
Use Schema and fields for validation; request.session for sessions; app.add_middleware for CORS, security headers, rate limits, and CSRF; Jinax for HTML; Mailer for email; Cache for caching; TestClient or AsyncTestClient for HTTP tests.
Admin, CMS, and data
Use AdminDashboard for authenticated model management and CMS for schema-driven content. Run flaxon migrate --direction up for migrations. Adapters include SQLite, PostgreSQL, MySQL, SQLAlchemy, MongoDB, Redis, and CustomAdapter; MongoDB and Redis use native APIs rather than SQL methods.
Operations
/health, /health/live, /health/ready, /metrics; flaxon routes, doctor, docs, inspect, worker, and schedule.
See the Admin/CMS guide, Email guide, and Teloce-Py guide for complete examples.