Django “TemplateDoesNotExist ” Error but “Using loader django.template.loaders.app_directories.Loader” File Exists

前端 未结 7 1984
我在风中等你
我在风中等你 2021-01-05 19:05

Template Loader finds the template but template is not loaded

TemplateDoesNotExist at /cardpayment/

cardpayment.html

Request Method:     G         


        
7条回答
  •  灰色年华
    2021-01-05 19:34

    Find settings.py in your python project and add following line. I hope it will work

    SETTINGS_PATH = os.path.normpath(os.path.dirname(__file__))
    TEMPLATE_DIRS = (
       os.path.join(SETTINGS_PATH, 'templates'),
    )
    

提交回复
热议问题