Browse documentation

Deploy Python web apps, workers and scheduled scripts

Serve a WSGI endpoint, run a background worker, or save the result of a scheduled Python command with a bounded timeout.

Start a Python web app

Open Python hosting and choose Python web app. Download the Python HTTP example and upload its project to Files. Set MAIN_FILE to main.py, start the deployment, and copy the HTTPS address from Settings.

Open the address in a browser. The example’s home page links to /api/health. Open that link and check the response below. This exercises the WSGI application and its public route together.

GET /api/health
{"service": "python-web", "status": "ok"}

Start a framework project

Keep requirements.txt at the project root and include your chosen server dependency. The sample uses a small standard-library server for its demonstration. For an ASGI application named app in main.py with Uvicorn in its requirements, set RUN_COMMAND to the following command. Adjust the module and object names to match your project.

Variables · RUN_COMMAND
python -m pip install -r requirements.txt && python -m uvicorn main:app --host 0.0.0.0 --port "$SERVER_PORT"

Use Variables for credentials and Deploy for a connected branch. After a code change, check Console for import errors and request a route that exercises the changed code.

Observe a background process

The Always-on worker profile suits a process that continuously consumes work. Upload the worker example, start main.py and watch Console for a timestamped heartbeat each minute. Use flush=True on progress messages when you need them to appear immediately.

Run a finite script once or on an interval

Choose One-off Python script for a manual task or Scheduled Python script for recurring work. The job example writes a JSON report and exits. Upload it at the root. Start the runner and select Run now in Runs. Check the exit result and the finished timestamp.

On the scheduled profile, set JOB_INTERVAL_SECONDS to 3600 for an hourly UTC interval. Set JOB_TIMEOUT_SECONDS to a suitable limit, save and restart. Runs shows the next occurrence and recent outcomes. A value of 0 for the interval pauses the schedule. See handling missed and overlapping runs before relying on a recurring report.