I can not find answer in other places. (Sorry for asking again but)
what is wrong? Did anyone have such an error?
ProgrammingError at /register/ relation "user_user" does not exist LINE 1: SELECT (1) AS "a" FROM "user_user" WHERE "user_user"."userna...
I extended user abstract model and error saying no relation When i extend user in sqlite3 no errors such this but postgre is full databse error
class User(AbstractUser):
social_username = models.CharField(max_length=100, null=True, blank=True)
views.py
def registration(request):
if request.method == 'POST':
form = RegisterUserForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=username, password=raw_password)
login(request, user)
messages.success(request,'You were successfully registered %s' % user.first_name)
return HttpResponseRedirect('/')
messages.error(request, 'Something went wrong while authenticating')
return render(request, 'project/register.html', {'form': form})
else:
form = RegisterUserForm()
return render(request, 'project/register.html', {'form': form})
settings.py
AUTH_USER_MODEL = 'user.User'
Not sure why this error occurs but you could just run this command and you are good to go without losing your data.
python manage.py migrate --run-syncdb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With