-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
23 lines (18 loc) · 867 Bytes
/
Copy pathsetup.py
File metadata and controls
23 lines (18 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from app import app, db, User
def create_user(username, email, password, is_admin=False):
user = User.query.filter_by(username=username).first()
if not user:
user = User(username=username, email=email, is_admin=is_admin)
user.password = password
db.session.add(user)
db.session.commit()
if __name__ == "__main__":
with app.app_context():
# Create the tables if they don't exist
db.create_all()
create_user("admin", "admin@example.com", "adminpassword", True)
create_user("alice", "alice@example.com", "alicepassword")
create_user("ai", "ai@example.com", "aipassword")
create_user("managerai", "managerai@example.com", "aipassword")
create_user("clientai", "clientai@example.com", "aipassword")
create_user("agentai", "agentai@example.com", "aipassword")