{% extends 'base.html' %} {% block title %}Home | QuickFlask{% endblock %} {% block head %} {{ super() }} {% endblock %} {% block content %}
Welcome to your newly created Flask app powered by QuickFlask. QuickFlask helps you build projects very fast by eliminating repetitive boilerplate code and setting up a structured project layout.
Here are the key components of your project structure and how to begin:
app/
. All your app's core logic and structure will reside here.app/__init__.py
. This is where Flask's app instance is created and configurations are initialized.Blueprints
, which are located in app/blueprints/
. Blueprints help structure your app into logical modules.app/blueprints/home.py
. This blueprint defines the routes and views for the homepage of your application.app/blueprints/api.py
. You can test the API at the endpoint: /api/test.app/blueprints/auth.py
. You can login using this endpoint: /login.app/blueprints/auth.py
. You can register using this endpoint: /register.The following routes are available in this application:
Note: To update this page, modify app/templates/home.html
.
Flask is a minimalistic WSGI (Web Server Gateway Interface) web application framework for Python. It focuses on simplicity and flexibility, which makes it ideal for both beginners and seasoned developers. Flask provides the core tools needed to get a web application up and running quickly, while allowing developers to add only the features they need.
Some key features of Flask include:
Blueprints allow you to organize your application into smaller, reusable components. They are essential for larger applications that require modularization. Each blueprint encapsulates routes, templates, static files, and other components that relate to a specific feature or functionality.
To create a new blueprint, follow these steps:
app/blueprints/
.app/__init__.py
).Flask uses Jinja2 as its template engine, allowing you to create dynamic HTML pages by embedding Python-like expressions in your HTML. This makes it possible to render data from Python objects directly into your HTML files.
Benefits of using Jinja2 with Flask:
Flask is a great choice for a web framework because of its minimalism, flexibility, rich ecosystem, and rapid development features. Whether you're building a small project or scaling a larger application, Flask can handle your needs without adding unnecessary complexity.
QuickFlask is a CLI tool designed to help you create modular, functional Flask applications in seconds. It helps you build projects very fast by eliminating repetitive boilerplate code and setting up a robust project structure. QuickFlask is built by Aditya and the source code is available on GitHub.
To install QuickFlask, run:
pip3 install quick-flask
Once installed, create a new Flask project by running:
quickflask
Options:
--name
(Required): The name of your Flask application.Example
quickflask --name my_flask_app
After creating your project, navigate into the directory:
cd my_flask_app
Set up a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Run the Flask app:
python app.py
Your application will be accessible at http://127.0.0.1:5000/
.
Feel free to open issues or submit pull requests to improve QuickFlask. Contributions are always welcome! The source code is available on GitHub.
This project is licensed under the MIT License.