Deploy Flask website using AWS CLI with AWS Lambda, AWS API Gateway, and Zappa
- >mkdir demo
- >cd demo
- demo> virtualenv <name_virtualenv>
- demo> %HOME_Path%\ <name_virtualenv> \Scripts\activate
- (<name_virtualenv>) C:\> pip install flask
- (<name_virtualenv>) C:\> pip install Flask zappa
- (<name_virtualenv>) C:\> pip freeze
- (<name_virtualenv>) C:\> pip freeze > requirements.txt
Prerequisites:
To deploy a Flask website, first create a virtual environment using below commands in cmd terminal…
To check environment is now active like below: (<name_virtualenv>) C:\>
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:
zappa update dev
Comments
Post a Comment