You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
347 B
Python
19 lines
347 B
Python
from freeposte import db, models
|
|
from passlib import hash
|
|
|
|
|
|
# Initialize the database
|
|
db.create_all()
|
|
|
|
domain = models.Domain(name="example.com")
|
|
user = models.User(
|
|
localpart="admin",
|
|
domain=domain,
|
|
global_admin=True,
|
|
password=hash.sha512_crypt.encrypt("admin").
|
|
)
|
|
|
|
db.session.add(domain)
|
|
db.session.add(user)
|
|
db.session.commit()
|