0

I just created a project in django using django-admin startproject xyz and then, I navigated to the project folder and created a superuser using the command python manage.py createsuperuser on my Ubuntu's terminal and I filled the details. After this, I started the server by python manage.py runserver and I went to http://127.0.0.1:8000/admin/ on my browser and everything seemed to be normal:

Image of the admin login page

Then, I clicked on the submit button after entering the admin credentials and this showed up:

Image of the 403 Forbidden page

Please help.

Suraj S Jain
  • 515
  • 3
  • 10
  • 24
  • [UPDATE] Guys, I just got the solution. I had to disable CSRF validation as per this post: https://stackoverflow.com/questions/16458166/how-to-disable-djangos-csrf-validation . I know that this method isn't so reliable, but it worked for me/ – Suraj S Jain Oct 28 '18 at 13:52
  • 1
    Presumably your browser has a cookie named `csrftoken` from a previous installation associated with `localhost`. Just remove it and reload. – jrief Oct 28 '18 at 16:08

1 Answers1

-1

Stackoverflow throws this django admin login suddenly demanding csrf token. I'm sure one of the solutions will work for you.

Uroš Trstenjak
  • 903
  • 8
  • 14