19 lines
511 B
Python
19 lines
511 B
Python
|
|
import os
|
||
|
|
from dotenv import load_dotenv
|
||
|
|
|
||
|
|
print("Before loading .env:")
|
||
|
|
print(f"DATABASE_URL: {os.environ.get('DATABASE_URL', 'Not set')}")
|
||
|
|
|
||
|
|
# 加载.env文件
|
||
|
|
result = load_dotenv()
|
||
|
|
print(f"load_dotenv() result: {result}")
|
||
|
|
|
||
|
|
print("After loading .env:")
|
||
|
|
print(f"DATABASE_URL: {os.environ.get('DATABASE_URL', 'Not set')}")
|
||
|
|
|
||
|
|
# 检查当前目录
|
||
|
|
print(f"Current directory: {os.getcwd()}")
|
||
|
|
print("Files in current directory:")
|
||
|
|
for file in os.listdir('.'):
|
||
|
|
if file.startswith('.env'):
|
||
|
|
print(f" {file}")
|