feat: moved project from lab2

This commit is contained in:
TAskMAster339
2026-10-10 12:14:31 +03:00
parent 0ab3a341aa
commit a856733fe9
59 changed files with 5346 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
import secrets
from pathlib import Path
path = Path(__file__).resolve().parents[1] / ".env"
if not path.exists():
with path.open("x", encoding="utf-8") as file:
file.write(
"POSTGRES_DB=messenger\n"
"POSTGRES_USER=messenger\n"
f"POSTGRES_PASSWORD={secrets.token_hex(24)}\n"
"SESSION_TTL_SECONDS=3600\n"
)
print("Created .env with a new local password.")
else:
print("Using existing .env.")