--- title: "Flask" url: https://docs.catalyst.zoho.com/en/serverless/help/appsail/help-guides/python/flask/ description: "Catalyst AppSail is a fully-managed PaaS component of Catalyst Serverless that enables you to develop and deploy services in Java, Node.js, and Python in the cloud with ease, and manage your platform instances." last_updated: 2025-11-03T10:48:29Z service: Serverless type: general --- # Flask App with zcatalyst-sdk [Flask](https://flask.palletsprojects.com/en/2.2.x/) is a popular, lightweight microframework of Python that developers can use to build highly functional applications. It does not use any libraries or tools, but supports a wide range of extensions for a variety of functionalities. Flask comes with a fast and built-in debugger and development server, as well as offers secure cookies, Unicode support and more. This example illustrates the steps to build a simple Python app with the Flask framework and Catalyst Python SDK. This application will then be bundled and associated with an AppSail service, and deployed to the console. > **Note:** Catalyst offers a built-in support for the Flask framework through the [Catalyst Python SDK](https://docs.catalyst.zoho.com/en/sdk/python/v1/overview). You can create [Catalyst serverless functions](https://docs.catalyst.zoho.com/en/serverless/help/functions/introduction/) using this SDK package. 1. Create a new folder in your local system for the Flask app. 2. Navigate to the directory from your terminal and execute the following command to install Flask and the [Python `zcatalyst-sdk`](https://docs.catalyst.zoho.com/en/sdk/python/v1/setup/#installing-the-sdk): ```python python3 -m pip install flask -t . python3 -m pip install --pre zcatalyst-sdk -t . ``` 3. You can now create your python index file and name it `app.py` or anything of your choice. Add the logic you require in the application's code. Given below is a sample code for a basic "Hello World" program. ```python import os from flask import Flask, request app = Flask(__name__) @app.route('/') def hello(): return 'Hello, World!' @app.route('/sdk') def sdk(): try: import zcatalyst_sdk as zcatalyst app = zcatalyst.initialize(req=request) cache_resp = app.cache().segment().put('Key', 'value') return cache_resp, 200 except Exception as e: return 'Got exception: ' + repr(e) if __name__ == '__main__': listen_port = int(os.getenv('X_ZOHO_CATALYST_LISTEN_PORT', 9000)) app.run(host="0.0.0.0", port=listen_port) ``` 4. You can now [initialize an AppSail service](https://docs.catalyst.zoho.com/en/cli/v1/initialize-resources/initialize-appsail/) in the same directory from the CLI or [add it](https://docs.catalyst.zoho.com/en/cli/v1/add-appsail/) in an existing project directory. The app's source must be your application's directory. Provide the following value while initializing the app service: **Stack**: Python_3_9 5. Ensure all the Python application files along with the `flask` and `zcatalyst-sdk` modules are present in the build directory you specify during initialization. Catalyst will automatically ZIP your app files during deployment to the remote console. 6. [Deploy the app service](https://docs.catalyst.zoho.com/en/cli/v1/deploy-resources/deploy-appsail//) to the console. 7. You can then configure the [startup command](https://docs.catalyst.zoho.com/en/serverless/help/appsail/key-concepts/appsail-execution/#startup-commands) given below from the console: ```python python3 -u app.py ``` You can also configure this in the `app-config.json` file before deploying. Access the deployed app service from its [endpoint URL](https://docs.catalyst.zoho.com/en/serverless/help/appsail/key-concepts/appsail-execution/#custom-domain-url).