django: User Registration with error: no such table: auth_user
./manage.py migrate
If you've just enabled all the middlewares etc this will run each migration and add the missing tables.
Only thing you need to do is :
python manage.py migrate
and after that:
python manage.py createsuperuser
after that you can select username and password.
here is the sample output:
Username (leave blank to use 'hp'): admin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
Update
You are probably getting this error because you are using UserCreationForm
modelform, in which in META
it contains User
(django.contrib.auth.models > User) as model.
class Meta:
model = User
fields = ("username",)
And here you are using your own custom auth model, so tables related to User
has not been created. So here you have to use your own custom modelform. where in Meta class, model should be your User
(books.User) model