Flask is a Python-based light-weight Web framework. This topic describes how to use Flask to create an application and deploy the application in Web+.

Step 1: Create an application.

  1. Create a directory named weplusdemo and create a file named application.py in the directory.
    └── application.py
  2. Add the following snippet to the application.py file.
    from flask import Flask
    app = Flask(__name__)
    def hello_world():
        return 'Hello World!

Step 2: Create a deployment package

Go to the webplusdemo directory, and use the following command to create a deployment package named webplusdemo.zip.
zip -r webplusdemo.zip . /

Step 3: Deploy the application in Web+

  1. Log on to the Web+ console.
  2. On the Overview page, click Create in the Last Updated Environments section.
  3. In the Basic Information step, select Python in the Technology Stack Type field and enter an application name and description. After the configuration is complete, click Next.
  4. In the Environment Information step, enter a environment name, select Upload Local Application in the Deployment Package Source field, and upload the webplusdemo.zip deployment package. After configuring the deployment package version, click Creation Complete.
  5. In the Creation Complete step, click View Application or Creation Complete to go to the Overview tab of the Application Details page. Click the name of an environment to go to the Overview tab of the Environment Details page. Then, click the link next to the Public IP Address label to view the homepage of the application.

More information