add dotenv

This commit is contained in:
2025-03-04 21:06:55 +08:00
parent 0ad0a079b4
commit 8c849f132d
4 changed files with 16 additions and 0 deletions

View File

@@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/5.1/ref/settings/
import os import os
from pathlib import Path from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent

View File

@@ -12,5 +12,6 @@ dependencies = [
"gunicorn>=23.0.0", "gunicorn>=23.0.0",
"psycopg[binary]>=3.2.5", "psycopg[binary]>=3.2.5",
"pydantic[email]>=2.10.6", "pydantic[email]>=2.10.6",
"python-dotenv>=1.0.1",
"uvicorn>=0.34.0", "uvicorn>=0.34.0",
] ]

View File

@@ -15,6 +15,7 @@ psycopg==3.2.5
psycopg-binary==3.2.5 psycopg-binary==3.2.5
pydantic==2.10.6 pydantic==2.10.6
pydantic-core==2.27.2 pydantic-core==2.27.2
python-dotenv==1.0.1
sqlparse==0.5.3 sqlparse==0.5.3
typing-extensions==4.12.2 typing-extensions==4.12.2
uvicorn==0.34.0 uvicorn==0.34.0

11
uv.lock generated
View File

@@ -233,6 +233,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186 }, { url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186 },
] ]
[[package]]
name = "python-dotenv"
version = "1.0.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/bc/57/e84d88dfe0aec03b7a2d4327012c1627ab5f03652216c63d49846d7a6c58/python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", size = 39115 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6a/3e/b68c118422ec867fa7ab88444e1274aa40681c606d59ac27de5a5588f082/python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a", size = 19863 },
]
[[package]] [[package]]
name = "sqlparse" name = "sqlparse"
version = "0.5.3" version = "0.5.3"
@@ -285,6 +294,7 @@ dependencies = [
{ name = "gunicorn" }, { name = "gunicorn" },
{ name = "psycopg", extra = ["binary"] }, { name = "psycopg", extra = ["binary"] },
{ name = "pydantic", extra = ["email"] }, { name = "pydantic", extra = ["email"] },
{ name = "python-dotenv" },
{ name = "uvicorn" }, { name = "uvicorn" },
] ]
@@ -297,5 +307,6 @@ requires-dist = [
{ name = "gunicorn", specifier = ">=23.0.0" }, { name = "gunicorn", specifier = ">=23.0.0" },
{ name = "psycopg", extras = ["binary"], specifier = ">=3.2.5" }, { name = "psycopg", extras = ["binary"], specifier = ">=3.2.5" },
{ name = "pydantic", extras = ["email"], specifier = ">=2.10.6" }, { name = "pydantic", extras = ["email"], specifier = ">=2.10.6" },
{ name = "python-dotenv", specifier = ">=1.0.1" },
{ name = "uvicorn", specifier = ">=0.34.0" }, { name = "uvicorn", specifier = ">=0.34.0" },
] ]