Deploying Python on CloudStation

Introduction

Python is a versatile and widely-used programming language known for its simplicity and efficiency. Whether you're deploying a Flask, Django, or FastAPI application, CloudStation provides a seamless platform for deployment.

This guide will walk you through deploying a Python application on CloudStation.


Prerequisites

Before starting, ensure you have the following:

  1. A Python Application: You can use an existing project or create a new one.
  2. GitHub Account Connected to CloudStation: CloudStation supports GitHub integration for automated deployments. Learn how to link your GitHub account here.

Creating a Python Application

If you don’t have a Python application yet, follow these steps to create one:

  1. Install Python
    Ensure you have Python installed on your machine.

  2. Set Up a Virtual Environment

    python -m venv venv
    source venv/bin/activate  # On Windows, use venv\Scripts\activate
  3. Install Dependencies

    pip install flask  # or django, fastapi, etc.
  4. Create a Simple App (Example: Flask)

    from flask import Flask
    app = Flask(__name__)
    
    @app.route("/")
    def home():
        return "Hello, CloudStation!"
    
    if __name__ == "__main__":
        app.run(host='0.0.0.0', port=5000)
  5. Run the Application Locally

    python app.py

For more details, refer to the official Python documentation.


Deploy Python on CloudStation

Deploying Python to CloudStation

  1. Log in and Create a New Project or Select an Existing One

    • Log into CloudStation, go to Dashboard > New Project, and click Add New Git Repo. Select your Python project and import it.
    • If you don't have a project, create a new one.

    More details

  2. Connect Your GitHub Repository

    • If your GitHub account isn’t linked, follow the prompts to connect it.
    • Select your Python project repository from the available list.
      More details
  3. Set Up Deployment Configuration

    • Ensure your requirements.txt is included in the repository.
    • Specify the start command (e.g., gunicorn app:app for Flask, python manage.py runserver for Django).
    • Configure any required environment variables.
      More details
  4. Deploy Your Python Application
    Click Deploy to start the deployment process. CloudStation will pull the latest code from your repository and deploy your application.

    More details


Edit this file on GitHub