Start by creating the virtual environment:

virtualenv -p python3.6 zappa_example

make sure to use Python 3.6

Let’s start a Zappa project:

cd zappa_example

. bin/activate

mkdir zappa_project

touch zappa_project/__init__.py

zappa init

pip install zappa flask

When initializing a new Zappa project, the framework will ask you some questions that will be used to configure the project:

███████╗ █████╗ ██████╗ ██████╗ █████╗

╚══███╔╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗

███╔╝ ███████║██████╔╝██████╔╝███████║

███╔╝ ██╔══██║██╔═══╝ ██╔═══╝ ██╔══██║

███████╗██║ ██║██║ ██║ ██║ ██║

╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ Welcome to Zappa! Zappa is a system for running server-less Python web applications on AWS Lambda and AWS API Gateway.

This `init` command will help you create and configure your new Zappa deployment.

Let's get started! Your Zappa configuration can support multiple production stages, like 'dev', 'staging', and 'production'.

What do you want to call this environment (default 'dev'): dev AWS Lambda and API Gateway are only available in certain regions. Let's check to make sure you have a profile set up in one that will work.

We found the following profiles: default, xxxx, xxxxx, xxxxxx, xxxxxx, and xxxxxx. Which would you like us to use? (default 'default'): Your Zappa deployments will need to be uploaded to a private S3 bucket.

If you don't have a bucket yet, we'll create one for you too.

What do you want call your bucket? (default 'zappa-c49kj1rye'): What's the modular path to your app's function?

This will likely be something like 'your_module.app'.

Where is your app's function?: zappa_project.app You can optionally deploy to all available regions in order to provide fast global service.

If you are using Zappa for the first time, you probably don't want to do this!

Would you like to deploy this application globally? (default 'n') [y/n/(p)rimary]: Okay, here's your zappa_settings.json: {

"dev": {

"app_function": "zappa_project.app.app",

"aws_region": "eu-west-1",

"profile_name": "default",

"project_name": "zappa-example",

"runtime": "python3.6",

"s3_bucket": "zappa-c49kj1rye"

}

} Does this look okay? (default 'y') [y/n]: Done! Now you can deploy your Zappa application by executing: $ zappa deploy dev After that, you can update your application code with: $ zappa update dev

and stop by our Slack channel here: To learn more, check out our project page on GitHub here: https://github.com/Miserlou/Zappa and stop by our Slack channel here: https://slack.zappa.io Enjoy!,

~ Team Zappa!

As you may read, I used the “dev” environment and kept everything to the default values apart the modular path to your app’s function that I configured to

zappa_project.app.app

since my module (the application main folder) is called zappa_project, my function will be written in app.py file and my Flask application will be called app.

Now you can see your configuration file under zappa_example:

{

"dev": {

"app_function": "zappa_project.app",

"aws_region": "eu-west-1",

"profile_name": "default",

"project_name": "zappa-example",

"runtime": "python3.6",

"s3_bucket": "zappa-c49kj1rye"

}

}

Now we can deploy our Zappa application by executing: