django开发错误处理

来源:互联网 发布:php输出三角形 编辑:程序博客网 时间:2024/05/18 09:07

在用open flash chart 的时候遇到这样一个问题,网站部署完成之后runserver,通过浏览器访问之后,页面报错如下

Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

此时http的错误代码为500


对应处理办法为:

将settings.py中的以下部分

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source,
    'django.template.loaders.app_directories.load_template_source,
#     'django.template.loaders.eggs.load_template_source',
)

修改为

    'django.template.loaders.filesystem.Loader,

    'django.template.loaders.app_directories.Loader,

之后重新runserver就好了

附:

http状态码

总体范围 已定义范围    类  别
100~199 100~101       信息
200~299 200~206       成功
300~399 300~305       重定向
400~499 400~415       客户端错误
500~599 500~505       服务器错误


原创粉丝点击