INBOX/test.md
2026-08-07 15:50:54 +02:00

1.4 KiB
Raw Blame History

Flask Login App Markdown Guide

Goal Build a minimal Flask app that:

  1. Uses SQLite for persistence.
  2. Has a login page, an index page (requires auth), and a logout route.
  3. Uses FlaskLogin and Werkzeug for password hashing.
  4. Is ready for a CLIAI to read and walk you through the implementation.

1. Project Overview

  • What it does Basic authentication + protected landing page.
  • Tech stack Flask, FlaskLogin, Werkzeug, SQLite, Jinja2.
  • Why SQLite Zeroconfig, filebased DB that ships with Python.

2. Prerequisites

  • Python3.9+ installed.
  • pip available.
  • Optional: virtualenv or venv for isolation.

3. Directory Layout (suggested)

my_flask_app/ │ ├── app/ │ ├── init.py │ ├── models.py │ ├── routes.py │ ├── templates/ │ │ ├── base.html │ │ ├── index.html │ │ └── login.html │ └── static/ # optional, for CSS/JS │ ├── migrations/ # if you later add FlaskMigrate │ ├── config.py # app config (secret key, DB URI, etc.) ├── run.py # entry point ├── requirements.txt └── README.md


4. Setting Up the Environment

  1. python -m venv venv
  2. source venv/bin/activate (Linux/macOS) or venv\Scripts\activate (Windows).
  3. Create requirements.txt with:
Flask
Flask-Login
Werkzeug