I am coding a web application with django and now I am starting to handle users. I'm trying to make the easy part, just creating a new admin user interface, but when I try to do this, I get an error message and I can not find information about it.
I enter the django administrator, register with the superuser, go to users, add the user. It only requests a username and password. When I submit changes, I get a NOT NULL constraint, this is:
NOT NULL constraint failed: auth_user.last_login
I reviewed the django documentation, and there it says to create such a user:
- from django.contrib.auth.models import User
- user = User.objects.create_user ('john', ' lennon@thebeatles.com ', 'johnpassword')
So, I open the terminal and do "./manage.py shell" "import django" "import User", and then I try to execute this code, but it also fails, it says:
NameError: name 'User' is not defined
Perhaps I changed something in the first part of the project? I created models, patterns, URLs and used / static / to link to files.
Thank you for your help!
rul3s source share