The app.py file consists of the app route and the run statement, while the static folder stores the CSS, JS, and image files we would require in building our web application. In the cloned repository, we have the app.py file, the static folder, and the templates folder. To examine the basic structure of a Flask web application, let’s clone this repository here Examining a Basic Flask Application Structureīefore we delve into the structuring of a large-scale Flask application, let’s first understand how a basic Flask application is structured. However, if you have no prior knowledge of setting up a Flask web application, read my article on the Flask framework here. To keep the introductory section of this article concise, I won’t cover how to set up a Flask web application. However, if you have a different preference in terms of IDE, then you should consider installing a virtual environment and installing Flask. In this tutorial, the use of P圜harm Integrated Development Environment is recommended, because it has all the features required to set up a basic application. Structuring Applications with Blueprint and Application Factory.Working with Configuration and Environment Variable.Examining a Basic Flask Application Structure.Intermediate understanding of databases.Intermediate knowledge with the use of terminals.Understanding of Flask views and templates.Understanding of Object-Oriented Programming concepts with Python.Intermediate usage and implementation of a Flask web app.The prerequisites for this article includes an understanding of the following concepts: To avoid the obstacles resulting in structuring a large application poorly, there are two main techniques used in structuring applications with Flask, which are: Blueprints and Application Factory. In building large applications, the use of package structure in structuring your application will result in a tactless codebase which inevitably results in issues such as circular imports. However, when building a small or medium-scale app, the structure of such application might not be of immense importance, especially if using the package structure technique. There are various techniques adopted by software developers to structure a Flask application.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |