Deploy Flask website using AWS CLI with AWS Lambda, AWS API Gateway, and Zappa

    Prerequisites:
    1. Python
    2. pip
    3. virtualenv
    4. awscli
    To deploy a Flask website, first create a virtual environment using below commands in cmd terminal…
    1. >mkdir demo
    2. >cd demo
    3. demo> virtualenv <name_virtualenv>
    4. demo> %HOME_Path%\ <name_virtualenv> \Scripts\activate
    To check environment is now active like below: (<name_virtualenv>) C:\>
    Now, Install all necessary dependencies in a virtual environment
    1. (<name_virtualenv>) C:\> pip install flask
    2. (<name_virtualenv>) C:\> pip install Flask zappa
    3. (<name_virtualenv>) C:\> pip freeze
    4. (<name_virtualenv>) C:\> pip freeze > requirements.txt
    Download the following zip file extract it and copy the app.py and templates folder into demo folder
    Now Our flask website is ready to deploy
    zappa init
    When you run this command it asks you to enter certain details from that create zappa_settings.json file please leave all the details as default
    Now, run the following command to deploy the website
    zappa deploy dev
    This command gives you one link as an output which you need to enter in browser to see the output
    OUTPUT:
    After updating the website run following command to update the environment
    zappa update dev

Comments

Popular posts from this blog

Simple Web-application deployment on EC2 using AWS CodeDeploy & S3 services

Voice-based library management system using Amazon Alexa

Deploy Django website using AWS Elastic Beanstalk CLI in windows