Answers for "setup templates in django"

1

make new app folder in django templates dir

#settings.py
TEMPLATES = [
    {
        ...
        'DIRS': [os.path.join(BASE_DIR, 'templates'),
                 os.path.join(BASE_DIR, 'templates', 'the_folder_you_created'),
                ...
                ]
    }
]
Posted by: Guest on June-18-2020
3

how to connect templates in django

# Template directory setting
TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'templates'),
)
Posted by: Guest on April-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language