开发者

Logging in django gives server error

开发者 https://www.devze.com 2023-01-05 15:19 出处:网络
In my settings.py file I\'ve added the following lines to enable logging. But unexpectedly now my project throws \"500 Internal Server Error\". Any ideas why ?

In my settings.py file I've added the following lines to enable logging. But unexpectedly now my project throws "500 Internal Server Error". Any ideas why ?

import logging
logging.basicConfig(
    level=logging.DEBUG,
    format='%(asctime)s %(levelname)s %(message)s',
    filename=os.path.join(rootdir, 'django.log'开发者_开发技巧),
    filemode='a+')


Try "python ./manage.py shell" and see what you get. Since it runs settings.py before giving you a prompt you should see some standard Python error messages. There are many times when Django errors are easier to debug from the command line than through a browser->server->mod_python->django chain (or whatever).

0

精彩评论

暂无评论...
验证码 换一张
取 消