Skip to content

"No POST data" in error report #7953

@bblanchon

Description

@bblanchon

Checklist

Description

I'm using Django 3.1.7 & DRF 3.12.2.
When an exception occurs in a ViewSet, Django automatically sends an email to the administrator.

The problem is that the POST data is always empty in this email:

POST: No POST data

Instead, I expect to see the JSON payload that was sent in the request body.

I added a breakpoint in django.utils.log.AdminEmailHandler.emit(), and I can confirm that request.POST is empty.
But on the other hand, I'm sure that request.data was not empty in the ViewSet.

I verified that the request's Content-Type and X-Requested-With are correctly set.
The only non-standard middlewares I use are corsheaders and admin_reorder; I don't think they are related to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions