1π
β
Did you run python manage.py migrate
before you ran python manage.py createsuperuser
?
During createsuperuser
process, you need the username and password, you donβt need anything else, i.e. email.
You should do this first, then run python manage.py runserver
lastly, navigate to http://127.0.0.1:8000/admin/
There really isnβt anything else you would need to do. If you are getting another error, please post it.
π€ja408
3π
Go to the python shell:
python manage.py shell
In the python console, run the following:
from django.contrib.auth.models import User
user = User.objects.get(username='your_username') # enter inside the quotes the username you entered when you ran python manage.py createsuperuser
user.set_password('new_password') # change the password
user.is_superuser = True
user.is_staff = True
user.save()
exit()
Then try to login again using the credentials you set.
π€Victor
- [Django]-Running Django on Google Colab
- [Django]-How to eliminate inefficiency of django query in a loop?
- [Django]-How to add extra fields to django registration form?
0π
I had similar problems too but by doing as follows it worked fine.
def create_superuser(self, username, email, password=None, **extra_fields):
user = self.create_user(username, email, password=password, is_staff=True, **extra_fields)
user.is_active = True
user.save(using=self._db)
return
π€Vkash Poudel
- [Django]-Descriptor 'date' requires a 'datetime.datetime' object but received a 'unicode'
- [Django]-Django import search path
- [Django]-Django β serving a SPA from static folder
- [Django]-AttributeError: 'CharField' object has no attribute 'model'
- [Django]-Django Project can't force Google Appengine to redirect to https
Source:stackexchange.com