django中TypeError: __init__() missing 1 required positional argument: 'app_module'
是因为不小心在settings.py中TEMPLATES加了app注册, 将其注释掉即可
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'press.apps.AppConfig',
],
},
},
]