Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No cookie with key "csrftoken". Wrong name? #230

Open
ericel opened this issue Mar 3, 2022 · 0 comments
Open

No cookie with key "csrftoken". Wrong name? #230

ericel opened this issue Mar 3, 2022 · 0 comments

Comments

@ericel
Copy link

ericel commented Mar 3, 2022

I am getting this error in production.
I have no idea why but it's due to this package.
Screen Shot 2022-03-03 at 8 53 11 PM

My Form has the csrftoken set:

<form method="post" action="." enctype="multipart/form-data">
 {% csrf_token %} 
..
</form>

and my setting file:

MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    # Cors Headers App
    "corsheaders.middleware.CorsMiddleware",
    "django.middleware.common.CommonMiddleware",
    # End Cors Headers App
    "django.middleware.locale.LocaleMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant