Django Template does not exist error, although it shows 'file exists'

后端 未结 3 962
抹茶落季
抹茶落季 2020-12-10 07:26

I am not able to render any html pages in Django 1.7. My \'index.html\' is in \'project/seatalloc/templates/index.html\' and my view.py in proje

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 08:18

    Try like this,

    import os
    BASE_DIR = os.path.dirname(os.path.dirname(__file__))
    TEMPLATE_DIRS = (
         os.path.join(BASE_DIR, 'templates/'),
    )
    

提交回复
热议问题