Skip to main content

Deploy a Flask App on Leapcell

You can deploy a Flask Python app on Leapcell in just a few clicks.

This quickstart uses a simple example app. You’re welcome to use your own Flask app instead.

info

You’ll need a GitHub account to proceed. If you don’t have one, you can create on the GitHub website.

1. Fork the Flask example on GitHub.

Repo: Flask example

Here’s the app.py file from that repo, which is borrowed from the official Flask docs:

from flask import Flask
app = Flask(__name__)

@app.route("/")
def index():
return "Hello Leapcell"

if __name__ == "__main__":
app.run(debug=True)

2. Create a Service in the Leapcell Dashboard and connect your new repo.

Go to the Leapcell Dashboard and click the New Service button.

On the "New Service" page, select the repository you just forked.

tip

To access your repositories, you’ll need to connect Leapcell to your GitHub account.

Follow these instructions to connect to GitHub.

Once connected, your repositories will appear in the list.

3. Provide the following values during creation:

info

We will use Gunicorn to run the Django app, so ensure you add gunicorn to your requirements.txt.

FieldValue
RuntimePython (Any version)
Build Commandpip install -r requirements.txt
Start Commandgunicorn -w 1 -b :8080 app:app
Port8080

Enter these values in the corresponding fields.

4. Access Your App:

Once deployed, you should see a URL like foo-bar.leapcell.dev on the Deployment page. Visit the domain shown on the service page.

Continuous Deployments

Every push to the linked branch automatically triggers a build and deploy. Failed builds are safely canceled, leaving the current version running until the next successful deploy.

Learn more about Continuous Deployments.