Web Dev Academy Backend frameworks · Django & Flask Tool 43 / 64
Backend frameworks

Django & Flask

Python's two big web frameworks. Django is "batteries-included" with an ORM, admin and auth out of the box; Flask is a tiny, flexible micro-framework you grow piece by piece.

Demo 01

Flask: a route returns a response

Flask maps a URL to a Python function with the @app.route decorator. Type a path and "request" it — the simulated dev server matches a view and replies.

Routes: /, /hello/<name>, /api/time
from flask import Flask, jsonify
app = Flask(__name__)

@app.route('/hello/<name>')
def hello(name):
    return f'Hello, {name}!'

@app.route('/api/time')
def api_time():
    return jsonify(time='12:00:00')
Demo 02

Django ORM → SQL → result table

Django's ORM turns Python method chains into SQL. Pick a queryset and watch the simulated Article table respond — plus the SQL Django would generate.

Demo 03

Django models & migrations

You describe your data as a Python class; Django generates the database schema. Click to run makemigrations + migrate and watch it work.

# blog/models.py
class Article(models.Model):
    title   = models.CharField(max_length=200)
    status  = models.CharField(max_length=20)
    views   = models.IntegerField(default=0)
    created = models.DateTimeField(auto_now_add=True)
    Demo 04

    The famous Django admin

    Register a model and Django builds a full CRUD admin UI for free. This is a simulated peek at what auto-generates.

    Just one line in admin.py:
    admin.site.register(Article)
    → generates this admin list view:
    Demo 05

    Django vs Flask

    Same language, opposite philosophies.

    Django

    Full-stack & opinionated. ORM, admin, auth, forms and templates included. Great for content sites, dashboards and large teams that want convention.

    Flask

    Minimal & flexible. Start with just routing; add an ORM (SQLAlchemy), forms etc. only when you need them. Great for small APIs and microservices.

    i
    The Flask route console, Django ORM table, migration runner and admin preview are simulated with vanilla JavaScript — real Django & Flask run Python on a server (WSGI/ASGI) with a real database. The code blocks show genuine Python/Django/Flask syntax. The shared CSS shell provides page styling.

    ↑ All 64 tools