Answer the question
In order to leave comments, you need to log in
What does user.save(using=self._db) mean?
Good afternoon.
Went through part of the django documentation yesterday. There is an example at the very bottom.
In general, I can’t understand what the parameter and its value mean using=self._db
in the code:
...
def create_superuser(self, email, date_of_birth, password):
"""
Creates and saves a superuser with the given email, date of
birth and password.
"""
user = self.create_user(email,
password=password,
date_of_birth=date_of_birth
)
user.is_admin = True
user.save(using=self._db)
return user
....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question