A clean, minimal, and hands-on learning journey into Flask, the lightweight and flexible Python web framework. This repository mirrors a real-world development setup β from environment to project organization β for building scalable Flask apps step by step.
Flask is a micro web framework for Python.
- Lightweight and minimal
- Flexible structure β you define your architecture
- Easy to learn and perfect for beginners
- Extensible with a rich ecosystem of third-party tools
| Feature | Flask | Django |
|---|---|---|
| Design | Micro-framework (minimal core) | Full-stack framework |
| Structure | Developer-defined (flexible) | Convention-based (pre-defined) |
| Admin UI | Not included by default | Built-in admin panel |
| Best For | APIs, small apps, rapid prototyping | Large-scale feature-rich apps |
| Learning Curve | Simple & beginner-friendly | Steeper but comprehensive |
mkdir Flask-Learning && cd Flask-Learning\apppython -m venv MyEnvironment.\MyEnvironment\Scripts\Activate.ps1
or
.\Flask-Learning\MyEnvironment\Scripts\Activate.ps1To deactivate:
deactivatepip install flaskFlask-Learning/
β
βββ app/ # Core application folder
β βββ app.py # Entry point that initializes and runs the Flask app
β
β βββ controllers/ # Handles route logic using Blueprints (modular routing)
β β βββ welcome_controller.py # Blueprint for handling the '/' route (e.g., Welcome page)
β
β βββ services/ # Business logic abstraction layer
β β βββ welcome_service.py # Contains logic for managing and returning welcome-related data
β
β βββ templates/ # Jinja2 templates for rendering dynamic HTML content
β βββ Welcome.html # Template that uses variables (e.g., name, names list)
β
βββ MyEnvironment/ # Virtual environment
βββ .gitignore # Excludes virtual environment and cache/temp files
βββ Readme.md # Project documentation and learning progress
Once you're inside the virtual environment and at the root of your project:
python app.pyBy default, Flask will run on:
http://127.0.0.1:5000
If you've set a custom host and port (like
0.0.0.0:3000), Flask will reflect that in the terminal when the server starts.
- Setting up Flask with a virtual environment
- Installing and configuring Flask
- Rendering static and dynamic content using Jinja2 templates
- Structuring Flask apps cleanly with folders like
templates/,controllers/, andservices/ - Using Blueprints to modularize routes
- Creating a Service Layer to manage business logic separately
- Sending data (variables, lists) from Python to HTML
- This marks the end of the Flask learning phase..
- π§ Now continuing the journey by building a real-world >ToDo App using Flask..
π Follow my next repo here β
Flask-ToDo-App(https://github.com/Madhav-P-2005/Flask-ToDo-App.git)
Happy Coding π§ͺβ¨