修改一下配置文件
This commit is contained in:
parent
e39e712e6d
commit
024847575c
@ -4,9 +4,17 @@ ASGI config for daren project.
|
||||
|
||||
import os
|
||||
import django
|
||||
import pathlib
|
||||
|
||||
# 设置Django设置模块
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daren.settings')
|
||||
|
||||
# 确保logs文件夹存在
|
||||
BASE_DIR = pathlib.Path(__file__).resolve().parent.parent
|
||||
logs_dir = os.path.join(BASE_DIR, 'logs')
|
||||
if not os.path.exists(logs_dir):
|
||||
os.makedirs(logs_dir)
|
||||
|
||||
django.setup() # 添加这一行
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
@ -153,6 +153,12 @@ STATIC_URL = 'static/'
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
# 确保logs文件夹存在
|
||||
logs_dir = os.path.join(BASE_DIR, 'logs')
|
||||
if not os.path.exists(logs_dir):
|
||||
os.makedirs(logs_dir)
|
||||
|
||||
# 日志配置
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
|
@ -8,9 +8,16 @@ https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daren.settings')
|
||||
|
||||
# 确保logs文件夹存在
|
||||
BASE_DIR = pathlib.Path(__file__).resolve().parent.parent
|
||||
logs_dir = os.path.join(BASE_DIR, 'logs')
|
||||
if not os.path.exists(logs_dir):
|
||||
os.makedirs(logs_dir)
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
Loading…
Reference in New Issue
Block a user