1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/admin/initdb.py

19 lines
352 B
Python
Raw Normal View History

2016-03-20 16:37:48 +02:00
from freeposte.admin import db, models
from passlib import hash
2016-02-21 17:47:30 +02:00
# Initialize the database
db.create_all()
domain = models.Domain(name="example.com")
user = models.User(
localpart="admin",
domain=domain,
global_admin=True,
2016-03-20 16:37:48 +02:00
password=hash.sha512_crypt.encrypt("admin")
)
db.session.add(domain)
db.session.add(user)
2016-02-21 17:47:30 +02:00
db.session.commit()