Reference: http://my.oschina.net/zuoan001/blog/188782
In Django's setting, there are two configurations for finding a template:
Template_loaders
Template_dirs
The template_loaders is a string tuple and the optional configuration is:
Django.template.loaders.filesystem.Loaderdjango.template.loaders.app_directories. Loaderdjango.template.loaders.eggs.Loaderdjango.template.loaders.cached.Loader
The first two loader are turned on by default, and the latter two are off by default.
By default, Django uses filesystem first. Loader, only when the filesystem. Loader The template is not found, the app_directories is used. Loader
FileSystem. Loader how to find a template: It will find the template according to Template_dirs.
The default settings.py does not have this configuration and needs to be added manually. Setup Example:
' Templates ' = [Os.path.join (Os.path.dirname (Os.path.abspath ("__file__" ) Templates')]
How to find a template in Django