您的位置:首页 > 编程语言 > Go语言

django开发错误处理

2012-11-13 09:19 246 查看
在用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       服务器错误
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  django