1👍
As of version 5.3.1 of raven-python it should correctly patch Django’s BaseCommand.execute, which effectively will handle errors in these commands (unless that parent call is never made).
0👍
For those out there that:
-
still have an issue of raven not patching itself for django management commands correctly
-
have Django==1.6.11
- haven raven==5.12.0
I have found a fix that works for me.
The problem seems to be that raven is not patching BaseCommand.execute
by the time it is called by Django. So to fix that, I make sure BaseCommand.execute
is patched right away. I’ve updated my manage.py
file to include the following lines:
from raven.contrib.django.management import patch_cli_runner
patch_cli_runner()
My final manage.py
file looks like this:
#!/usr/bin/env python
from os.path import abspath
from os.path import dirname
import os
import sys
if __name__ == "__main__":
# add the ../ directory to the os path, so that we can find
# app.settings below
sys.path.insert(0, os.path.abspath(os.path.join(dirname(abspath(__file__)), '..')))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
from django.core.management import execute_from_command_line
from raven.contrib.django.management import patch_cli_runner
patch_cli_runner()
execute_from_command_line(sys.argv)
👤Paul
- [Answer]-Cannot find screen.css compass/sass in django project that is compiling correctly
- [Answer]-Django CreateView does not save object
- [Answer]-Can I link Django permissions to a model class instead of User instances?
- [Answer]-Unable to access upvote/downvote input in a Django template
Source:stackexchange.com