I made some changes to the project structure, mainly is using blueprint to organize the code mentioned before, but I'm not sure whether it conflicts with your code style. but don't worry, even if it doesn't fit, I think my future projects may use this :), the main changes are as follows:
A remote package was created to separate the configuration files(eg: flake8 / bandit / dockerfile / ...) with the biz code. It should be noted that the position of configuration file(config.py / config.example.py should be moved to the `remote' directory).
The app.py are split into three blueprints(index_bp / image_bp /network_bp) and placed in the remote/blueprints/ directory, I try to make them look independent of each other, each blueprint only import
the built-in modules.
third-party packages.
some common methods in projects(APIError / success / error / ...).
Adjusted the app startup process. See remote/app.py for more details.
Adjusted the structure of the test. it corresponds to the structure of the biz code, i think is convenient to organize and maintain later.
During the test, I found that dockerfile has missing some dependencies, and it didn't run successfully in my test, so I added the some dependencies (gcc / libavif-dev) and simply adjusted the structure.
related #16
I made some changes to the project structure, mainly is using blueprint to organize the code mentioned before, but I'm not sure whether it conflicts with your code style. but don't worry, even if it doesn't fit, I think my future projects may use this :), the main changes are as follows:
A
remote
package was created to separate the configuration files(eg: flake8 / bandit / dockerfile / ...) with the biz code. It should be noted that the position of configuration file(config.py
/config.example.py
should be moved to the `remote' directory).The app.py are split into three blueprints(
index_bp
/image_bp
/network_bp
) and placed in theremote/blueprints/
directory, I try to make them look independent of each other, each blueprint only importAPIError
/success
/error
/ ...).Adjusted the app startup process. See
remote/app.py
for more details.Adjusted the structure of the test. it corresponds to the structure of the biz code, i think is convenient to organize and maintain later.
During the test, I found that dockerfile has missing some dependencies, and it didn't run successfully in my test, so I added the some dependencies (
gcc
/libavif-dev
) and simply adjusted the structure.