Skip to main content

Introduction

This guide covers deploying Flask applications on Shard Cloud. Flask is a lightweight WSGI web framework for Python.

Creating Your Project

Ensure you have Python and pip installed. Download from python.org.

Installing Flask

Basic Flask Application

Create an app.py file:
app.py

Requirements File

Create a requirements.txt:
requirements.txt

Production Server with Gunicorn

Flask’s built-in server is not suitable for production. Always use Gunicorn.

Shard Cloud Configuration

Create a .shardcloud file:
.shardcloud
For production with Gunicorn:
.shardcloud

Deploying

1

Prepare Your Files

Ensure you have: - app.py - requirements.txt - .shardcloud
2

Exclude Unnecessary Files

Remove: __pycache__/, venv/, *.pyc
3

Create ZIP Archive

Compress your project folder.
4

Upload to Shard Cloud

Go to Shard Cloud Dashboard and upload.

Additional Resources

Visit the official Flask documentation for more information.

Troubleshooting

Ensure all dependencies are listed in requirements.txt.
Verify you’re binding to 0.0.0.0 and port 80.