mirror of
https://github.com/patrickbeane/quote-of-the-day.git
synced 2026-01-27 18:30:25 +00:00
Secure, rate‑limited Flask + Gunicorn microservice with SQLite persistence, delivery tracking, and systemd deployment config. Includes setup script, HTML template, and production‑ready README.
26 lines
643 B
Python
26 lines
643 B
Python
import sqlite3
|
|
|
|
conn = sqlite3.connect("quotes.db")
|
|
c = conn.cursor()
|
|
|
|
quotes = [
|
|
("Strive not to be a success, but rather to be of value.", "Albert Einstein"),
|
|
("I find that the harder I work, the more luck I seem to have.", "Thomas Jefferson")
|
|
]
|
|
|
|
c.execute("""
|
|
CREATE TABLE IF NOT EXISTS quotes (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
quote TEXT NOT NULL,
|
|
author TEXT NOT NULL,
|
|
delivered INTEGER DEFAULT 0
|
|
)
|
|
""")
|
|
conn.commit()
|
|
|
|
for quote, author in quotes:
|
|
c.execute("INSERT INTO quotes (quote, author) VALUES (?, ?)", (quote, author))
|
|
|
|
conn.commit()
|
|
conn.close()
|