Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Admin Login page - Python Crashes

I am trying to login to admin url of the Django post creating superuser through command prompt. After i clicked log in button i am getting "Python has stopped working".

Python Ver: 3.7.0 Django Ver: 3.0

  • Step 1: Created website using django-admin command

  • Step 2: Using runserver command verified Django Default home page is loading

  • Step 3: Tried admin/ post creating super admin users.

  • Step 4: Post Login button click, "Python Stopped working" error is displayed.


What I tried to solve this issue without any success

  1. Verified through shell my created user is active, superadmin, is_staff and all are true
    from django.contrib.auth import authenticate

    u = authenticate(username="username", password="password")
  1. Tried adding and removing SESSION_COOKIE_SECURE = False in settings.py

  2. Verifed ALLOWED_HOSTS = [] in settings.py

    What should I do to see the admin page?

like image 857
useruser00 Avatar asked Dec 06 '19 09:12

useruser00


2 Answers

I had the same problem with python 3.7.0 and Django 3.0 I've solved it by upgrading the python to Python 3.7.6

brew upgrade python3

Then I faced some issues with links and venv and I had to reinstall my venv and Django. So, I hope it helps someone.

like image 52
Tim Titov Avatar answered Sep 22 '22 11:09

Tim Titov


I got the same issue with Python 3.7.0 as well. Upgrading to Python 3.8.0 solves this.

like image 24
waitingkuo Avatar answered Sep 19 '22 11:09

waitingkuo