(feat): Init concept of coming soon landing page
This commit is contained in:
parent
18bcafe29b
commit
f8f8c773cc
9 changed files with 179 additions and 77 deletions
24
database.py
Normal file
24
database.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import sqlite3
|
||||
|
||||
def init_db():
|
||||
conn = sqlite3.connect('subscribers.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS subscribers (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
email TEXT UNIQUE NOT NULL
|
||||
)
|
||||
""")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def add_email(email):
|
||||
try:
|
||||
conn = sqlite3.connect('subscribers.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("INSERT INTO subscribers (email) VALUES (?)", (email,))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return True
|
||||
except sqlite3.IntegrityError:
|
||||
return False
|
||||
Loading…
Add table
Add a link
Reference in a new issue