this is a very basic and quick question in Django.
So in my views, where I am handling the registration, if a user tries to register with a username that already exists I want to just give a message, like a span next to the form, saying, "wrong username".
How do I print that message?
Thank you.
This is my part of code:
def register(request): if request.method == 'POST': if User.objects.filter(username = request.POST['username']).exists(): #I want to show next to the username textfield in registration form, #a span for example that says "Wrong Username"