Flaxon FFD
Bridge FastAPI, Flask, and Django apps into a single Flaxon application via ASGI mounting.
Flaxon FFD is a Flaxon plugin that lets you run real, unmodified FastAPI, Flask, or Django apps side-by-side with your Flaxon app in the same process — useful for gradual migrations, reusing an existing service, or pulling in a framework-specific tool (like Django's admin, or FastAPI's auto-generated docs) without rewriting it.
from flaxon import Flaxon
from flaxon_ffd import FFDPlugin
from fastapi import FastAPI
fastapi_app = FastAPI()
@fastapi_app.get("/hello")
def hello():
return {"hello": "world"}
app = Flaxon("main")
await app.plugins.load_plugin(FFDPlugin(mounts={"/fastapi": fastapi_app}))
GET /fastapi/hello now hits your real FastAPI route — including FastAPI's own path converters, dependency injection, and auto-generated /fastapi/docs Swagger UI, completely unmodified.
How it works
Under the hood this uses app.mount_asgi(path, foreign_app) — for any request under that path prefix, Flaxon hands the raw ASGI call straight to the mounted app's own __call__, bypassing Flaxon's routing and middleware for that subtree entirely. The mounted app handles everything itself, exactly as if it were running on its own.
What this is: running multiple independent apps together in one process, each on its own URL prefix. What this isn't: a way to use Flask/FastAPI/Django extensions as if they were native Flaxon plugins. A Flask extension mounted this way still only works inside that mounted Flask app — it doesn't become available to your Flaxon routes.
Installation
pip install flaxon-ffd[fastapi] # for FastAPI
pip install flaxon-ffd[flask] # for Flask (includes a2wsgi)
pip install flaxon-ffd[django] # for Django
pip install flaxon-ffd[all] # all three
Mounting Flask or older Django (WSGI apps)
FastAPI and Django's get_asgi_application() are already ASGI — mount them directly. Flask (and WSGI-only Django setups) need translating first, via a2wsgi:
from flask import Flask
from a2wsgi import WSGIMiddleware
flask_app = Flask(__name__)
@flask_app.route("/hello")
def hello():
return {"hello": "world"}
app.plugins.load_plugin(FFDPlugin(mounts={
"/flask": WSGIMiddleware(flask_app),
}))
Mounting Django
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.core.asgi import get_asgi_application
django_app = get_asgi_application()
app.plugins.load_plugin(FFDPlugin(mounts={
"/django": django_app,
}))
Multiple mounts at once
app.plugins.load_plugin(FFDPlugin(mounts={
"/fastapi": fastapi_app,
"/flask": WSGIMiddleware(flask_app),
"/django": django_app,
}))
Requirements
- Flaxon >= 0.1.9
- Python >= 3.11
License
MIT
Metadata
Release files for flaxon-ffd 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flaxon_ffd-0.1.0.tar.gz | 3.5 kB | Without provenance | Details for flaxon_ffd-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flaxon_ffd-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for flaxon_ffd-0.1.0-py3-none-any.whl |
Total release size: 7.1 kB
Release files / flaxon_ffd-0.1.0.tar.gz
| Download URL | flaxon_ffd-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
263f9d360b077837b8f859de306eae75784fdee4ea5928c01ce07b561cbb5e90
|
|
BLAKE2b-256 checksum How to use checksums |
9c9810130f28e0e5c811410c885da608f44157f5cc352dcacb16c51a904b6c01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / flaxon_ffd-0.1.0-py3-none-any.whl
| Download URL | flaxon_ffd-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf0bf14a25002e702fbe9538a93ef4f516b1115fac931f57cb2e1c8a350dbd4a
|
|
BLAKE2b-256 checksum How to use checksums |
9c4a0b98902262a46725e4fd38d3ea6233abe886ba3eb54d90698f79b62dd73b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for flaxon-ffd 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.