Get help from the marimo community

Updated 6 months ago

Deployment

At a glance

The community member @~Lightfury~ asked if it is possible to run a marimo project, which was written using fastapi, by using flask instead. The comments suggest that marimo is compatible with ASGI apps, and provide some guidance on how to use flask with ASGI apps. However, there is no explicitly marked answer on how to convert the fastapi code to flask. The community members suggest looking at the flask documentation and a related Stack Overflow question for more information.

Useful resources
@~Lightfury~ asked:

I am going to deploy my marimo project to the anywhere by flask
[9:33 AM]
but the code is written by fastapi
[9:33 AM]
Is it possible to run the marimo project by flask?
~
M
A
9 comments
Could you help me?
we support using marimo as a fully compatible ASGI app. so if you can find any documentation pairing Flask and ASGI apps - you can use
https://docs.marimo.io/guides/deploying/programmatically.html
I read the doc. the fask api works fine
but I need to run it via flask
import marimo
from fastapi import FastAPI


Create a marimo asgi app

server = (
marimo.create_asgi_app()
.with_app(path="", root="./dashboard.py")
)

Create a FastAPI app

app = FastAPI()


app.mount("/", server.build())

Run the server

if name == "main":
import uvicorn

uvicorn.run(app, host="localhost", port=8000)
how to convert the fastapi to flask?
Add a reply
Sign up and join the conversation on Discord