出现问题:django.template.exceptions.TemplateDoesNotExist: learning_logs/index.html

在settings.py的TEMPLATES对应的'DIRS'中添加: [os.path.join(BASE_DIR,'templates')]

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',
            ],
        },
    },
]

 

你可能感兴趣的:(编程学习,Python)