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 Hosting Python and choose Web app Python. Download the Python HTTP example and upload its project to Files. Set MAIN_FILE ke 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.
{"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.
python -m pip install -r requirements.txt && python -m uvicorn main:app --host 0.0.0.0 --port "$SERVER_PORT"Pakai Variables for credentials dan 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
Ini Worker yang selalu aktif 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 Skrip Python sekali jalan for a manual task or Skrip Python terjadwal for recurring work. The job example writes a JSON report and exits. Upload it at the root. Start the runner and select Jalankan sekarang in Runs. Check the exit result and the finished timestamp.
On the scheduled profile, set JOB_INTERVAL_SECONDS ke 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.