官术网_书友最值得收藏!

Configuring with Zappa

In order to configure Zappa, it's required that you have Zappa installed, as mentioned in the previous chapter. Zappa provides the zappa init command, which enables a user interactive mode initialization so that we can configure the Python application.

I followed the default configuration settings that were suggested by the zappa init command. This generates the zappa_settings.json file, which is the backbone for configuring any Python application with Zappa.

Here is the content of the zappa_settings.json file:

{
"dev": {
"app_function": "hello_world.app",
"aws_region": "ap-south-1",
"profile_name": "default",
"project_name": "flask-todo",
"runtime": "python3.6",
"s3_bucket": "zappa-yrze3w53y"
}
}

Now, during initialization, Zappa has the ability to identify the type of your Python application and generate the set attributes accordingly. In our case, Zappa detected the Python program as a Flask application. Hence, it asked for the Flask instance path, which we initialized as app = Flask(__name__) in the hello_world.py file.

Now that the Zappa configuration has been completed as per our basic needs, it's time to deploy it on AWS Lambda.

主站蜘蛛池模板: 井研县| 新沂市| 英德市| 浠水县| 武平县| 毕节市| 饶河县| 龙南县| 宜兴市| 洛浦县| 时尚| 丰台区| 铅山县| 沈丘县| 呼和浩特市| 措美县| 和平县| 东乌珠穆沁旗| 永定县| 甘孜县| 惠东县| 涿鹿县| 宁河县| 台湾省| 峡江县| 红安县| 雅江县| 榆中县| 抚松县| 枣庄市| 高青县| 三门峡市| 永川市| 濮阳市| 绍兴市| 南康市| 肥西县| 千阳县| 临澧县| 偏关县| 府谷县|