- Building Serverless Python Web Services with Zappa
- Abdulwahid Abdulhaque Barguzar
- 319字
- 2021-07-16 18:16:18
Scaffolding
While implementing any project from scratch, you are free to design the scaffolding of your project. We are going to follow the scaffolding shown in the following screenshot:

Let's look at each directory and its uses in detail:
- .env: This is our virtualenv directory, which has been created by the virtualenv command.
- auth: We are going to create a standalone generic authentication module using the Flask-Login and Flask-SqlAlchemy extensions.
- config: Here, we are going to create some configuration and generic database models, which may be needed by other modules.
- static: It's Flask standard practice to put the static content under the static directory. Hence, we will be using this directory for all required static content.
- templates: Flask has built-in support for the Jinja2 template engine and follows the standard layout for the template files based on the modules' names. We will see a detailed description of this later, when we actually utilize the templates.
- todo: This is a standalone Flask module or package which has the basic to-do functionality.
- __init__.py: This is Python's standard file that is required under a directory to build a Python package. We are going to write code here to configure our application.
- migrations: This directory is autogenerated by Flask-Migrate. In a future section, we will see how Flask-Migrate works.
- .gitignore: This contains a list of files and directories that should be ignored by Git versioning.
- LICENSE: I have created a Git repository using GitHub and included an MIT license for our flask_todo repository.
- README.md: This file is used to describe information about the repository on GitHub.
- requirements.txt: This is the file where we listed all the required packages mentioned in the preceding section.
- run.py: Here, we are going to create the final instance of our Flask application.
- zappa_settings.json: This file gets generated by Zappa and has Zappa-related configurations.
We will look at a detailed explanation of the code in the upcoming sections.
推薦閱讀
- 解析QUIC/HTTP3:未來(lái)互聯(lián)網(wǎng)的基石
- 光網(wǎng)絡(luò)評(píng)估及案例分析
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- 網(wǎng)管員必讀:網(wǎng)絡(luò)管理(第2版)
- Unity Artificial Intelligence Programming
- 網(wǎng)絡(luò)利他行為研究:積極心理學(xué)的視角
- 移動(dòng)物聯(lián)網(wǎng):商業(yè)模式+案例分析+應(yīng)用實(shí)戰(zhàn)
- 網(wǎng)絡(luò)空間全球治理觀察
- 數(shù)據(jù)血緣分析原理與實(shí)踐
- 全聯(lián)網(wǎng)標(biāo)識(shí)服務(wù)
- 基于IPv6的家居物聯(lián)網(wǎng)開(kāi)發(fā)與應(yīng)用技術(shù)
- 物聯(lián)網(wǎng)基礎(chǔ)及應(yīng)用
- Intelligent Mobile Projects with TensorFlow
- 物聯(lián)網(wǎng)與智慧廣電
- 想象的互動(dòng):網(wǎng)絡(luò)人際傳播中的印象形成