Configuring django settings to work with 1.4.1. Loading template error

北战南征 提交于 2019-12-03 10:26:56

If you look at the documentation on template loader types (scroll down to the cached template loader section), it looks like when you configure the cached loader you still need to pass it Loader classes - so you'd want to change your config to look like this:

if DEBUG:
    TEMPLATE_LOADERS = [
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',      
    ]
else:
    TEMPLATE_LOADERS = [
        ('django.template.loaders.cached.Loader',(
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
            'forum.modules.template_loader.module_templates_loader',
            'forum.skins.load_template_source',
            )),
    ]

I'm not sure what the loaders are for the forum app, but you probably also want Loader classes there as well (you'll need to read the documentation on that app to figure that out - not all third party template loaders work with the cached loader).

  1. Open the ‘settings.py‘ file in the folder which contains the extracted contents of the Twissandra project.
  2. Search, ‘TEMPLATE_LOADERS=(‘ and within it, search, ‘django.template.loaders.filesystem.load_template_source‘. Comment this line and add, ‘django.template.loaders.filesystem.Loader‘.
  3. Similarly, within ‘TEMPLATE_LOADERS=(‘, search, ‘django.template.loaders.app_directories.load_template_source‘, and replace it with, ‘django.template.loaders.app_directories.Loader‘.

P.S. I solved my problem and thanks How to fix the Django error displayed when loading Twissandra for the first time?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!