Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

config.py 1.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839
  1. class Settings:
  2. PROJECT_NAME: str = "VMS"
  3. PROJECT_VERSION: str = "1.0.0"
  4. POSTGRES_USER: str = "VMSBase"
  5. POSTGRES_PASSWORD = "VMSBasePass"
  6. POSTGRES_SERVER: str = "localhost"
  7. POSTGRES_PORT: str = "5432"
  8. POSTGRES_DB: str = "VMSData"
  9. DATABASE_URL = f"postgresql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_SERVER}:{POSTGRES_PORT}/{POSTGRES_DB}"
  10. ACCESS_TOKEN_EXPIRE: int = 60 * 24 * 7 # 7 days
  11. SECRET_KEY: str = "tH357aC6oA7ofCaN3yTffYkRh"
  12. ALGORITHM: str = "HS256"
  13. ALLOWED_TASK_STATUS: list = ["Pending", "In Progress", "Completed", "Cancelled"]
  14. settings = Settings()
  15. def createAdminAcc():
  16. from db.session import SessionLocal
  17. from db.repository.user import create_new_user
  18. from schemas.user import UserCreate
  19. from db.models.user import User
  20. db = SessionLocal()
  21. user = UserCreate(
  22. Email="madi.turgunov@nu.edu.kz",
  23. Password="1234567",
  24. Name="Madi",
  25. LastName="Turgunov",
  26. ContactNumber="+77071234567",
  27. Role="Admin",
  28. GovernmentId="123456789",
  29. Address="Nazarbayev University",
  30. )
  31. if db.query(User).filter(User.Email == user.Email).first():
  32. return False
  33. create_new_user(user=user, db=db)
  34. return True