A basic Flask starter project with SQLite, Bootstrap 5, and a blueprints-based route structure. Good starting point for a simple web app.
- Flask app with a blueprints route structure
- SQLite database with raw
sqlite3(no ORM) - Bootstrap 5 via Bootstrap-Flask
- Full CRUD example on a
poststable - Password generator and random-case utilities on the home page
- Docker support
venv/
├── app.py # App factory
├── init_db.py # Creates the database with sample data
├── schema.sql # Database schema
├── requirements.txt
├── routes/
│ ├── index.py # Home page, utilities
│ └── posts.py # Posts CRUD routes
├── templates/
│ ├── base.html
│ ├── index.html
│ └── posts/
└── tools/
├── rog_tools.py # General utilities
└── more_media.py # Media helpers
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r venv/requirements.txt
# Initialise the database (creates database.db with sample posts)
cd venv
python init_db.py
# Set required environment variables
export SECRET_KEY="your-secret-key-here"
export FLASK_APP=app.py
# Run the dev server
flask runThen open http://localhost:5000.
docker build -t rd-flask .
docker run -e SECRET_KEY="your-secret-key" -p 5000:5000 rd-flaskHow To Use an SQLite Database in a Flask Application — DigitalOcean