al3xtouch
al3xtouch

Reputation: 521

deploy web application using zappa

I was following the steps here: https://github.com/Miserlou/Zappa to try to deploy my web app to AWS.

My app is using flask as server side and it also uses flask to host client-side JavaScript, html and css files. I can successfully host it on my local machine and on a server machine (I used host="0.0.0.0" on the server and I also specified a port number).

All I need to do is to run python my_app.py. The client side sends requests to the server and the server will respond.

I tried to deploy with zappa, but the page loads to an empty one. I'm not sure where I did wrong. One thing is that there are external libraries needed for my python program, how do I install it when I deploy it to my AWS lambda?

Upvotes: 0

Views: 813

Answers (1)

Greg Detre
Greg Detre

Reputation: 653

You definitely need to install your external libraries locally first, and then Zappa will take care of uploading them as part of the zip file.

In other words:

  • virtualenv my_venv

  • source my_venv/bin/activate

  • pip install zappa flask django etc

  • then run a local webserver to test that your app works, e.g. flask run

  • zappa init

  • zappa deploy dev OR zappa update dev (if you've already run deploy)

Upvotes: 1

Related Questions