{"id":2746,"library":"raven","title":"Raven Client for Sentry","description":"Raven is the legacy Python client for Sentry, providing error and exception tracking for Python applications. It offers integrations for frameworks like Django and Flask, and supports general WSGI applications. The library is currently in maintenance mode, with new feature development and most bug fixes now occurring exclusively in the successor `sentry-sdk` library.","status":"maintenance","version":"6.10.0","language":"en","source_language":"en","source_url":"https://github.com/getsentry/raven-python","tags":["sentry","error tracking","logging","legacy"],"install":[{"cmd":"pip install raven","lang":"bash","label":"Install Raven"}],"dependencies":[],"imports":[{"symbol":"Client","correct":"from raven import Client"},{"note":"The `sentry_sdk` library uses a different API for capturing exceptions.","wrong":"sentry_sdk.capture_exception()","symbol":"captureException","correct":"client.captureException()"}],"quickstart":{"code":"import os\nfrom raven import Client\n\n# Get your DSN from Sentry (e.g., from environment variables)\ndsn = os.environ.get('SENTRY_DSN', 'https://examplePublicKey@o0.ingest.sentry.io/0')\n\n# Initialize the Raven client\nclient = Client(dsn)\n\ntry:\n    1 / 0\nexcept ZeroDivisionError:\n    client.captureException()\n    print(\"Error captured by Raven (check your Sentry dashboard).\")\n\nclient.captureMessage('This is a test message from Raven.')\nprint(\"Message captured by Raven.\")","lang":"python","description":"This quickstart demonstrates how to initialize the Raven client with a DSN and then capture an exception and a simple message. Replace the placeholder DSN with your actual Sentry DSN."},"warnings":[{"fix":"For new projects, use `pip install sentry-sdk` and follow its documentation. For existing Raven users, consult the official Sentry migration guide from Raven to `sentry-sdk`.","message":"Raven is the legacy Sentry client and is largely deprecated in favor of `sentry-sdk`. New projects should use `sentry-sdk` for an improved experience and all new features. Migrating from `raven` to `sentry-sdk` involves significant API changes.","severity":"breaking","affected_versions":"All versions of Raven (since `sentry-sdk` release)"},{"fix":"Adjust configuration to use direct `Client` instantiation with DSN and explicitly configure transports if needed, using `raven-aiohttp` for aiohttp integration.","message":"The `raven.conf.load` function was removed, and binding transports via a scheme prefix on DSNs was deprecated in version 5.4.0. The `aiohttp` transport was also moved to a separate `raven-aiohttp` package.","severity":"breaking","affected_versions":">=5.4.0"},{"fix":"Ensure your Sentry DSN is correctly configured and avoid using UDP transport options. Use a DSN for all server configurations.","message":"The UDP transport was removed in version 5.3.0. Additionally, server configuration *must* now be specified with a DSN.","severity":"breaking","affected_versions":">=5.3.0"},{"fix":"Upgrade to Raven 6.10.0 or later to ensure correct stackframe order and proper handling of `NaN` local variables. If migrating to `sentry-sdk` is not an immediate option, ensure you are on the latest `raven` release.","message":"In Raven versions prior to 6.10.0, stackframes in some situations could be in inverse order, and `NaN` local variables might be sent as non-standard JSON, potentially causing issues with Sentry event processing.","severity":"gotcha","affected_versions":"<6.10.0"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}