feat: moved project from lab2
This commit is contained in:
@@ -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.")
|
||||
Reference in New Issue
Block a user