question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No request data with django

See original GitHub issue

I recently decided to switch from Raven to sentry-sdk version 0.7.3.

When an event was reported using Raven I use to have many useful tags (the URLs originating the error, the user browser/device, OS information and much more). All this comes out of the box without the need to include any scripts in the frontend.

Despite sentry-sdk has simplified the configuration process I find myself with a weaker error tracking system (fewer information on each event).

I am working on a Django project and followed the docs

Am I missing something?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bluesurfercommented, May 23, 2019

@bcollazo @untitaker I have some updates.

I am following cookiecutter-django repository to lay down my project. It seems that with recent updates (also from sentry-sdk) the following configuration to me is working:

# LOGGING
# ------------------------------------------------------------------------------
LOGGING = {
    "version": 1,
    "disable_existing_loggers": True,
    "formatters": {
        "verbose": {
            "format": "%(levelname)s %(asctime)s %(module)s "
                      "%(process)d %(thread)d %(message)s"
        }
    },
    "handlers": {
        "console": {
            "level": "DEBUG",
            "class": "logging.StreamHandler",
            "formatter": "verbose",
        }
    },
    "loggers": {
        "django.db.backends": {
            "level": "ERROR",
            "handlers": ["console"],
            "propagate": False,
        },
        # Errors logged by the SDK itself
        "sentry_sdk": {"level": "ERROR", "handlers": ["console"], "propagate": False},
        "django.security.DisallowedHost": {
            "level": "ERROR",
            "handlers": ["console"],
            "propagate": False,
        },
    },
}

# Sentry
# ------------------------------------------------------------------------------
SENTRY_DSN = env("SENTRY_DSN")
SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO)

sentry_logging = LoggingIntegration(
    level=SENTRY_LOG_LEVEL,  # Capture info and above as breadcrumbs
    event_level=logging.ERROR,  # Send no events from log messages
)

sentry_sdk.init(
    dsn=SENTRY_DSN,
    integrations=[sentry_logging, DjangoIntegration(), CeleryIntegration()],
)

Therefore to me this issue could be closed.

0reactions
anush0247commented, Jun 26, 2019

@untitaker thank you it’s working now

Read more comments on GitHub >

github_iconTop Results From Across the Web

missing POST data in Django view - python - Stack Overflow
The weird thing is that in the Request Information section of the page it says that there's no POST information or GET information....
Read more >
Request and response objects - Django documentation
Django uses request and response objects to pass state through the system. ... If you need to access raw or non-form data posted...
Read more >
"No POST data" in error report · Issue #7953 - GitHub
I added a breakpoint in django.utils.log.AdminEmailHandler.emit() , and I can confirm that request.POST is empty. But on the other hand, ...
Read more >
Requests - Django REST framework
request.data returns the parsed content of the request body. ... and obvious - any HTTP method type may include query parameters, not just...
Read more >
Search Form & Request Data - Python & Django 3.2 Tutorial ...
22 - Search Form & Request Data - Python & Django 3.2 Tutorial SeriesTry Django 3.2 is a series to teach you the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found