This video is available to students only
Zappa Init
Now we set up our Zappa environment
Let's set up Zappa using the init
command, short for initialization. We'll only have to do this once for any of your projects. The goal will be to have a proper settings file called zappa_settings.json
In case you're not coming directly from the last module, make sure you activate your environment.
Run the Zappa init command:
1
(ve) zappashell> zappa init
You should see something like the following. It will prompt you with a few questions.
1
(ve) zappashell> zappa init
2
3
███████╗ █████╗ ██████╗ ██████╗ █████╗
4
╚══███╔╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗
5
███╔╝ ███████║██████╔╝██████╔╝███████║
6
███╔╝ ██╔══██║██╔═══╝ ██╔═══╝ ██╔══██║
7
███████╗██║ ██║██║ ██║ ██║ ██║
8
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝
9
10
Welcome to Zappa!
11
12
Zappa is a system for running server-less Python web applications on AWS Lambda and AWS API Gateway.
13
This `init` command will help you create and configure your new Zappa deployment.
14
Let's get started!
15
16
Your Zappa configuration can support multiple production stages, like 'dev', 'staging', and 'production'.
17
What do you want to call this environment (default 'dev'):
18
19
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.
20
We found the following profiles: default, and zappa. Which would you like us to use? (default 'default'): zappa
21
22
Your Zappa deployments will need to be uploaded to a private S3 bucket.
23
If you don't have a bucket yet, we'll create one for you too.
24
What do you want to call your bucket? (default 'zappa-k8cyysm1f'):
25
26
It looks like this is a Django application!
27
What is the module path to your projects's Django settings?
28
We discovered: frankie.settings
29
Where are your project's settings? (default 'frankie.settings'):
30
31
You can optionally deploy to all available regions to provide fast global service.
32
If you are using Zappa for the first time, you probably don't want to do this!
33
Would you like to deploy this application globally? (default 'n') [y/n/(p)rimary]: n
34
35
Okay, here's your zappa_settings.json:
36
37
{
38
"dev": {
39
"django_settings": "frankie.settings",
40
"profile_name": "zappa",
41
"project_name": "task",
42
"runtime": "python3.8",
43
"s3_bucket": "zappa-k8cyysm1f"
44
}
45
}
46
47
Does this look okay? (default 'y') [y/n]: y
48
49
Done! Now you can deploy your Zappa application by executing:
50
51
$ zappa deploy dev
52
53
After that, you can update your application code with:
54
55
$ zappa update dev
56
57
To learn more, check out our project page on GitHub here: https://github.com/zappa/Zappa and stop by our Slack channel here: https://zappateam.slack.com
This page is a preview of Serverless Django with Zappa