This is a base template for Flask web applications. It provides a structured starting point for new projects, adhering to best practices in Flask development and project organization.
- Modular design using Blueprints.
- Error handling for HTTP status codes 400, 403, 404, and 500.
- Template rendering using Jinja2.
- Environment-based configuration via
.envfile. - Basic file upload handling and static file serving.
- Pre-configured logging.
- Clone the repository.
- Copy
.env.exampleto.envand set your environment variables. - Install dependencies:
pip install -r requirements.txt. - Run the application:
flask run.
app/: Application package containing the Blueprints, static files, templates, and routes.app/static/: Directory for CSS, JavaScript, and image files.app/templates/: Jinja2 templates for the application.app/main/: Blueprint for the main application routes.instance/: Folder for instance-specific configurations (not under version control)..flaskenv: Flask-specific environment variables..env: General environment variables (not to be committed).application.py: Entry point for the Flask application.
Configure the application using the .env file. Reference .env.example for required variables.
To create a new project:
- Clone this repository.
- Rename the project folder.
- Initialize a new git repository.
- Customize the Blueprints and templates as needed.
Contributions to the template are welcome. Please fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Special thanks to all the contributors and maintainers of Flask and its extensions.