This video is available to students only

Our First Deployment

Ready to get into the cloud?

Ok, let's try to push our app to the cloud. We will run the Zappa deploy command. You will need to run this command for the initial deployment of any Zappa environment. Since we are essentially in development mode, we'll start off with a Zappa environment called dev. If this were your own project, you will eventually have quality assurance and production environments. It's important to have a consistent environment naming scheme. The Zappa documentation suggests dev, qa, and prod as a good convention.

The Zappa deploy command will create all the necessary AWS infrastructure that we will need. Once it's complete, any updates to the code can be done using the update command. We'll explore the update command later.

Unfortunately, we encounter an error:

The error botocore.exceptions.NoRegionError: You must specify a region. is the problem. Zappa is complaining that no AWS region is specified, so we need to specify one. Remember that Amazon has multiple AWS regions in which you may deploy your code. We recommend you select a region close to you to avoid unnecessary network delays.

Adding AWS region#

In this walkthrough, we are leveraging us-east-1, but feel free to add your local region. Just make sure the region you select supports AWS Lambda.

Let's edit the zappa_settings.json file with a region:

Try again#

Ok, let's give it another shot.

You should see something like the following.

 

This page is a preview of Serverless Django with Zappa

No discussions yet