Убрать надпись в регистрации Это поле обязательно для заполнения [закрыто]

I'm using the UserCreationForm built into Django to create a registration form, but there are extra 'This field is required.' prescriptions that these fields are required, I want to remove them, please help me, or at least translate it into Russian, if you can also help to fix clean_email in forms so that it does not always throw out this inscription after 1 test entry of an existing email. here is a screenshot of the result enter image description here

views.py:

class RegisterUser(CreateView):
    form_class = RegisterUserForm
    template_name = 'users/register.html'
    extra_context = {'title': 'Регистрация'}
    success_url = reverse_lazy('users:login')

forms.py:

class RegisterUserForm(UserCreationForm):
    username = forms.CharField(label="Логин:", widget=forms.TextInput(attrs={'class': "form-input"}))
    password1 = forms.CharField(label="Пароль:", widget=forms.PasswordInput(attrs={'class': "form-input"}))
    password2 = forms.CharField(label="Повтор пароля:", widget=forms.PasswordInput(attrs={'class': "form-input"}))

    class Meta:
        model = get_user_model()
        fields = {'username', 'email', 'first_name', 'last_name', 'password1', 'password2'}
        labels = {
            'username': 'Логин',
            'email': 'E-mail',
            'first_name': 'Имя',
            'last_name': 'Фамилия',
            'password1': 'Пароль',
            'password2': 'Повторить пароль',
        }
        widgets = {
            'username': forms.TextInput(attrs={'class': "form-input"}),
            'first_name': forms.TextInput(attrs={'class': "form-input"}),
            'last_name': forms.TextInput(attrs={'class': "form-input"}),
        }

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.order_fields(['username', 'email', 'first_name', 'last_name', 'password1', 'password2'])

    def clean_email(self):
        email = self.cleaned_data['email']
        if get_user_model().objects.filter(email=email).exists():
            raise forms.ValidationError("Такой E-mail уже существует")
        return email

users/register.html:

{% extends 'users/base.html' %}

{% block title %}Регистрация{% endblock %}

{% block content %}
<h1>Регистрация</h1>
<form method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <p><button type="submit">Регистистрация</button></p>
</form>
{% endblock %}

used and watched on the videos, but apparently such a question in the head of no one has not appeared for all time, I'm sure that it is done very easily, but I have no idea how

Вернуться на верх