What is the path for TEMPLATE_DIRS in django settings.py when using virtualenv

前端 未结 5 1739
感动是毒
感动是毒 2021-01-05 02:15

I am using virtualenv and I want to know what the TEMPLATE_DIRS in settings.py should be, for example if I make a templates folder in the root of m

5条回答
  •  不知归路
    2021-01-05 02:50

    Adding this in web/settings.py solved everything for me. Hope it can help you too.

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

提交回复
热议问题