27 lines
551 B
Python
27 lines
551 B
Python
#!/usr/bin/env python3
|
|
|
|
from app.db.session import get_db
|
|
from app.db.crud import create_user
|
|
from app.db.schemas import UserCreate
|
|
from app.db.session import SessionLocal
|
|
|
|
|
|
def init() -> None:
|
|
db = SessionLocal()
|
|
|
|
create_user(
|
|
db,
|
|
UserCreate(
|
|
email="maxiaozhe@alicorns.co.jp",
|
|
password="maxz1205",
|
|
is_active=True,
|
|
is_superuser=True,
|
|
),
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print("Creating superuser maxiaozhe@alicorns.co.jp")
|
|
init()
|
|
print("Superuser created")
|