This project creates a folder system for a Flask application, which is useful when you want to gain productivity without losing quality.
├── app/
│ ├── __init__.py
│ ├── settings.py
│ ├── routes/
│ │ ├── api/
│ │ │ ├── __init__.py
│ │ │ └── routes.py
│ │ └── __init__.py
│ └── cache/
│ └── __init__.py
├── .env.example
├── .gitignore
├── main.py
└── requirements.txt
-
app/
Directory- **init.py:** This file indicates that the 'app' directory should be treated as a Python package.
- settings.py: Configuration settings for the application.
- routes/: A subdirectory containing modules related to routing.
- api/:
- **init.py:** Marks the 'api' directory as a Python package.
- routes.py: Defines API-specific routes.
- site/:
- **init.py:** Marks the 'site' directory as a Python package.
- routes.py: Contains routes for the main site.
- **init.py:** Marks the 'routes' directory as a Python package.
- error_handler.py: Handles errors for the routes.
- api/:
-
.env
: Configuration file used to store environment variables for the application. -
.gitignore
: Specifies files and directories that should be ignored by version control. -
main.py
: The main entry point for the application. -
requirements.txt
: Lists the dependencies and their versions required for the project.
-
Clone the repository to your local machine:
git clone https://github.com/AdaiasMagdiel/create-flask-app.git
You can make a .bat
or a .sh
to run the project via cli. See a windows create-flask-app.bat
example:
@echo off
py path\to\this\project\main.py %*
Then, you can save this file in a folder thats is already in path and run:
create-flask-app test-app
This will create a test-app
folder with the project.
Feel free to modify and extend the application based on your requirements.