Logging in django gives server error
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).
精彩评论