Code Monkey home page Code Monkey logo

Comments (12)

gapadventures avatar gapadventures commented on May 22, 2024

As a hack, I just put in an invalid SENTRY_REMOTE_URL in my localsettings.py file:

SENTRY_REMOTE_URL = ['http://localhost/', ]

That is enough to stop my development box from sending the errors in.

from sentry.

dcramer avatar dcramer commented on May 22, 2024

I can easily do this within runtests.py, but not your own test suite. The problem is I can't determine whether you're running tests or not.

from sentry.

tclancy avatar tclancy commented on May 22, 2024

Is there a way to remove Sentry from settings.INSTALLED_APPS during testing? The database creation dies while trying to run a migration. I tried the following at the top of my test suite:

remove_for_testing = ['sentry', 'sentry.client']

new_apps = []
for app in settings.INSTALLED_APPS:
    if app not in remove_for_testing:
        new_apps.append(app)

settings.INSTALLED_APPS = tuple(new_apps)

but it looks like it runs too late, as South's migration manager still runs and complains there's no app named "Sentry".

from sentry.

ashchristopher avatar ashchristopher commented on May 22, 2024

If there was a settings.py variable set to specify whether to send errors to Sentry, you could turn off sentry logging at the top of your tests.py file. Might be a little crude in that you could technically modify the settings once in any test.py file, but until there is a django test specific settings file, not too sure what else to do.

We currently specify a separate test_settings.py file where we remove sentry (and related) from the INSTALLED_APPS. It works well enough for our Hudson instance, but is kind of a pain on your development box.

from sentry.

dcramer avatar dcramer commented on May 22, 2024

I will add a toggle to flat out disable sentry (though it may just be specifying the client as dummy). What we do locally is have our settings.py remove sentry/sentry.client from INSTALLED_APPS.

from sentry.

tclancy avatar tclancy commented on May 22, 2024

I'm happy to just do that rather than make you work around me. Can you just explain how you do that, since my code sample above isn't succeeding? Thanks.

from sentry.

dcramer avatar dcramer commented on May 22, 2024

tclancy, wrote this up real quick: http://justcramer.com/2011/01/13/settings-in-django/

from sentry.

tclancy avatar tclancy commented on May 22, 2024

That's awesome, thanks so much. It's usually just me, so I get away with the local_settings.py file, but that's good stuff.

from sentry.

maraujop avatar maraujop commented on May 22, 2024

Shouldn't this be closed?

from sentry.

dcramer avatar dcramer commented on May 22, 2024

Yes, it should :)

from sentry.

tclancy avatar tclancy commented on May 22, 2024

Totally lazy person's solution: rename/ delete/ move Sentry's /migrations folder.

from sentry.

tclancy avatar tclancy commented on May 22, 2024

And 12 seconds later, an actual, mature fix for the problem I was having: SOUTH_TESTS_MIGRATE = False in your settings file.

from sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.