当DEBUG = False时Django服务器错误(500)

时间:2019-04-17 06:21:44

标签: django

settings.py

<div *ngIf="$number | async as num"> 
   <div *ngIf="num> 0"> '(' {{num}} ')' </div>
</div>

ALLOWED_HOSTS = ["localhost", "192.168.0.7", "127.0.0.1"] MIDDLEWARE = [ 'django.middleware.common.BrokenLinkEmailsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] STATIC_ROOT = os.path.join(BASE_DIR, 'static_collection') STATIC_URL = '/static/' MEDIA_URL = '/data/' MEDIA_ROOT = os.path.join(BASE_DIR, 'data') EMAIL_BACKEND = env.str('EMAIL_BACKEND') EMAIL_HOST = env.str('EMAIL_HOST') EMAIL_PORT = env.int('EMAIL_PORT') EMAIL_HOST_USER = env.str('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = env.str('EMAIL_HOST_PASSWORD') EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS')

urls.py

当我设置DEBUG = True时,服务器可以运行。 但是,当我将DEBUG设置为False时,服务器会给我错误500。

解决方案是什么?

0 个答案:

没有答案