Suppression du blog par les post-it

This commit is contained in:
2022-07-10 15:09:03 +02:00
parent c37b974fe7
commit 6b264cd46b
19 changed files with 189 additions and 237 deletions

21
tools/databaseinit.py Normal file → Executable file
View File

@@ -1,27 +1,29 @@
#!venv/bin/python
import sqlite3
import sqlite3
import os.path
def init_db():
if os.path.isfile('base.db'):
return False
else:
else:
conn = sqlite3.connect('base.db')
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS users(
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
Mail CHAR(80) PRIMARY KEY UNIQUE NOT NULL,
name TEXT,
mail TEXT,
alias TEXT,
xmpp TEXT,
passwd TEXT,
avatar TEXT,
nom, TEXT,
nom TEXT,
prenom TEXT,
age TEXT,
profession TEXT
)
""")
website TEXT,
Token CHAR(30),
Mail_rescue TEXT )
""")
conn.commit()
print ('table users OK')
@@ -40,10 +42,9 @@ def init_db():
conn.close()
print ('table posts OK')
return True
def init_dir():
if os.path.isdir('users'):
return False
else:
os.makedirs('./users/')