Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
JH-Giftlist/make_db.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (10 sloc)
651 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import render_template | |
import sqlite3 | |
con = sqlite3.connect('events.db') | |
con.execute('CREATE TABLE events(id INT unsigned, name VARCHAR(255), date TEXT, time TEXT, image TEXT, description TEXT)') | |
con.close() | |
con = sqlite3.connect('events.db') | |
con.execute('INSERT INTO events(id, name, date, time, image, description) VALUES (1, "Rog and Anne", "2022-06-05", "12:00", "event-images/RA.jpg", "Wedding of Rog and Anne, Harston Church, Harston"),(2, "Sue and Keiko", "2022-08-01", "14:00", "event-images/SK.jpg", "Wedding of Sue and Keiko, Cambridge Registry Office, Cambridge");') | |
con.commit() | |
con.close() | |