Skip to content

CSRF checking fails for /admin #7

Closed

Description

@pamelafox

CSRF checking currently fails when trying to login to admin.
Screenshot 2022-11-16 at 3 26 37 PM

I fixed that this morning in my own Django Codespace-optimized repo. You can see how I fixed that here:
https://github.com/Azure-Samples/msdocs-django-postgresql-sample-app/pull/19/files

I'm happy to send a PR if you'd like.

Activity

  1. bdmac commented on Nov 17, 2022

    @bdmac
    Contributor

    I don't think we even realized there was an admin for this (we don't really do much Django work as you can imagine). Would love a PR for it if you have time!

  2. pamelafox commented on Nov 17, 2022

    @pamelafox
    ContributorAuthor

    Ah, Django's big selling point is its ORM and auto-generated admin for it, so yup, it's a good thing to get working. I've made the PR at #8
    Unfortunately, it won't work in the embedded browser window thats configured for this Codespace, since that seems to disable cookies, but will work in a proper external window.

  3. pamelafox commented on Nov 18, 2022

    @pamelafox
    ContributorAuthor

    Fixed via #8

  4. deepskydata commented on Jun 15, 2023

    @deepskydata

    Sorry to open this up again. I have a similar issue even with the fix. I tried it in an external browser but still got the origin error. CSFR token is sent with the request.

    Should I open a new issue?

  5. ethanolj commented on Jun 19, 2023

    @ethanolj

    @deepskydata - I just troubleshooted the same, after creating a new Django project using django-admin startproject. I opened #24 for this issue, however the #8 fix can be applied in the new project's settings.py file manually as a work-around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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