Sandip Patel

Let's move from "Have to" to "Want to"

Menu
  • Home
  • TECH CORNER
    • AWS
    • Networking
  • Videos
  • Expert Talk Delivered
  • Projects
  • Publications
  • About Me
Menu

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

Posted on February 18, 2020October 7, 2020 by Sandip Patel

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

flask.zip

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

Follow Me

               Qries

AWS Re: invent 2021 at Las Vegas

Achievements & Events

Faculty- Ambassador
Best Paper Presentation Award
AWS Academy Success Story on AWS official Blog
AWS Expert Talk 2020
USA-Conference
Paper Presentation
Conference-Team
AWS Expert Talk by IEEE 2020

RSS Recent Announcements

  • AWS Transit Gateway is now available in Asia Pacific (Melbourne) AWS Region June 2, 2023
  • Amazon Fraud Detector announces Event Orchestration with Amazon EventBridge June 2, 2023
  • Announcing fine-grained seller permissions access to AWS Marketplace Management Portal June 2, 2023
  • Amazon RDS for Oracle now supports converting instances to CDB architecture June 2, 2023
  • Amazon Interactive Video Service introduces Advanced channel types for flexible input encoding June 2, 2023

Recent Posts

  • Deployment of Website Using AWS CICD pipeline & Fargate
  • Install terraform on ubuntu and Create EC2 instance on AWS using terraform script
  • Install Cloudwatch agent on on-premises Windows server
  • Install Cloudwatch agent on on-premises Linux server
  • Deploy Flask website using AWS CLI with AWS Lambda, AWS API Gateway and Zappa
February 2020
S M T W T F S
 1
2345678
9101112131415
16171819202122
23242526272829
« Jan   Mar »
web counter
©2023 Sandip Patel | WordPress Theme by SuperbThemes