python - Enabling overriding of app template in django? -
I am writing a simple site to display some data, and I found an app called "statistics" That is, I want to write the default template (stats / templates / places), but I want to overdry them to be the template for the admin app in the same way. IE: If I put a statistic / view html in my project's template directory, then it will be used instead of one in my app directory. I can not seem to understand how to do it. Before this app can be found before finding the project TEMPLATE_DIRS TEMPLATE_DIRS?
EDIT: Problem found, using the OS module saw anyone's tutorial to set up template directories. They were:
TEMPLATE_DIRS = (os.path.join (os.path.basename (__ file__), 'template'))
Which Should be:
TEMPLATE_DIRS = (os.path.join (os.path.dirname (__ file__), 'template'))
Before you file system
loader app_directories
loader Your TEMPLATE_LOADERS
settings.
TEMPLATE_LOADERS = ('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source')
TEMPLATE_LOADERS
case order.
Comments
Post a Comment