Python
gy detects Python from requirements.txt or pyproject.toml, installs dependencies, and runs
your server.
Deploy
Section titled “Deploy”cd my-python-appgy deployExamples
Section titled “Examples”from flask import Flaskapp = Flask(__name__)
@app.route("/")def hello(): return "Hello from Ghaymah!"
if __name__ == "__main__": app.run(host="0.0.0.0", port=5000)gy deploy --port 5000FastAPI
Section titled “FastAPI”gy deploy --name my-fastapi --port 8000Django
Section titled “Django”gy deploy --port 8000Dependencies
Section titled “Dependencies”Declare dependencies in requirements.txt:
flask==3.0.0gunicorn==21.2.0or in pyproject.toml. gy installs them during the build.
Environment variables
Section titled “Environment variables”import osDATABASE_URL = os.environ["DATABASE_URL"]gy config set env DATABASE_URL=postgres://...gy config sync