As a developer, I love creating small, meaningful projects for personal use. My partner and I always struggle with gift ideas for anniversaries, birthdays, or just because. So I built a tiny web app that lets us both add, edit, and mark items as gifted. It’s a fun way to practice Flask and SQLite, plus it’s genuinely useful.
First, set up a basic Flask app. Create a virtual environment, install Flask, and make a file called app.py:
from flask import Flask, render_template, request, redirect, url_for, flash
import sqlite3
app = Flask(__name__)
app.secret_key = 'your-secret-key-here'
def init_db():
conn = sqlite3.connect('wishlist.db')
c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS items
(id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL,
link TEXT,
gifted BOOLEAN DEFAULT 0,
added_by TEXT)''')
conn.commit()
conn.close()
init_db()
Now, a route to display all items and add new ones:
@app.route('/', methods=['GET', 'POST'])
def index():
conn = sqlite3.connect('wishlist.db')
c = conn.cursor()
if request.method == 'POST':
name = request.form['name']
price = request.form.get('price', 0.0)
link = request.form.get('link', '')
added_by = request.form['added_by']
c.execute("INSERT INTO items (name, price, link, added_by) VALUES (?, ?, ?, ?)",
(name, price, link, added_by))
conn.commit()
flash('Item added!', 'success')
return redirect(url_for('index'))
c.execute("SELECT * FROM items ORDER BY gifted ASC, id DESC")
items = c.fetchall()
conn.close()
return render_template('index.html', items=items)
Create a simple HTML template in templates/index.html:
<!DOCTYPE html>
<html>
<head><title>Our Wishlist</title></head>
<body>
<h1>💝 Our Couple Wishlist</h1>
<form method="POST">
<input type="text" name="name" placeholder="Gift idea" required>
<input type="number" step="0.01" name="price" placeholder="Price (optional)">
<input type="url" name="link" placeholder="URL (optional)">
<select name="added_by">
<option value="You">You</option>
<option value="Partner">Partner</option>
</select>
<button type="submit">Add</button>
</form>
<ul>
{% for item in items %}
<li>
{% if item[4] %} ✅ {% endif %}
<strong>{{ item[1] }}</strong>
{% if item[2] %} - ${{ item[2] }} {% endif %}
{% if item[3] %} <a href="{{ item[3] }}">Link</a> {% endif %}
<small>Added by {{ item[5] }}</small>
<a href="{{ url_for('gift', id=item[0]) }}">Mark gifted</a>
</li>
{% endfor %}
</ul>
</body>
</html>
Finally, a route to toggle an item as gifted:
@app.route('/gift/<int:id>')
def gift(id):
conn = sqlite3.connect('wishlist.db')
c = conn.cursor()
c.execute("UPDATE items SET gifted = 1 - gifted WHERE id = ?", (id,))
conn.commit()
conn.close()
return redirect(url_for('index'))
Run it with flask run and you have a real, shared wishlist. No external APIs, no dependencies beyond Flask. Perfect for two people who want to keep track of thoughtful gifts—and avoid buying the same thing twice.
I actually use this with my partner. We add ideas from our favorite shops (like Frishay’s couple gifts collection) and mark them when we’ve picked something special. It’s small, it’s ours, and it works.
Top comments (4)
That's such a lovely idea—personalized gifts really do capture the essence of a relationship. I've found that creating a shared experience, like a cooking class or a weekend getaway, often has a lasting impact too. How did your partner react to the couple bracelets? Did they wear them often?
That's awesome that the photo frame and bracelets went over so well. I've found that combining a personalized item with a planned experience, like a picnic or cooking class, creates a gift they'll remember even longer.
I love that you went with experience-based and personalized gifts—those always feel more meaningful than something off the shelf. Curious, did you find the custom photo frame made a bigger emotional impact than the bracelets, or was it the combination that worked? I've been thinking about trying something similar for my partner's birthday this year.
I love the idea of experience-based gifts—they create lasting memories instead of just clutter. The custom photo frame sounds especially sweet; it's those personal touches that really show you care.