# Login has no errors, with Code 200

**URL:** <https://forum.djangoproject.com/t/login-has-no-errors-with-code-200/14303>\
**Category:** Forms & APIs\
**Created:** [June 15, 2022, 4:54pm UTC](https://forum.djangoproject.com/t/login-has-no-errors-with-code-200/14303 "2022-06-15T16:54:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmdMWddh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ahmdmwddh/32/21707_2.png) [@AhmdMWddh](https://forum.djangoproject.com/u/AhmdMWddh)\
**Post date:** [June 15, 2022, 4:54pm UTC](https://forum.djangoproject.com/t/login-has-no-errors-with-code-200/14303/1 "2022-06-15T16:54:30Z")

</div>

Login don’t work and don’t give any errors in Terminal and in html also, but it gives this 200 Code in terminal

Logic i want to achieve is :

- Using HTML form.
- Customize `LoginView` to change `template_name` and `class_form`.
- Customize AuthenticationForm to pass to `LoginView` `form_class`  
Any Clue i Can follow.

Thank You For Support In Advance.

```auto
[15/Jun/2022 16:04:44] "POST /users/sign-in HTTP/1.1" 200 10891

```

HTML:

```auto
<form class="ui form" method="POST" novalidate>
    {% csrf_token %}
    <div class="field">
        <label for="email">{{ form.email.label }}</label>
        <div class="ui left icon input">
            {{ form.email }}
            <i class="mail icon"></i>
        </div>
    </div>
    <div class="field">
        <label for="password">{{ form.password.label }}</label>
        <div class="ui left icon input">
            {{ form.password }}
            <i class="key icon"></i>
        </div>
    </div>
    {% if form.non_field_errors %}
    {% for error in form.non_field_errors %}
    <div class="ui negative message">
        <i class="close icon"></i>
        <p>{{ error }}</p>
    </div>
    {% endfor %}
    {% endif %}
    <button class="ui green large fluid button" type="submit">Sign In</button>
</form>

```

Url:

```auto
path('sign-in', views.ClientSignInView.as_view(), name='ClientSignInUrl'),

```

Views:

```auto
class ClientSignInView(LoginView):
    template_name = 'Users/Sign_In.html'
    authentication_form = ClientSignInForm
    success_url = 'Pages:HomeView'

    def get_context_data(self, **kwargs):
        context = super(ClientSignInView, self).get_context_data(**kwargs)
        context['page'] = 'Sign In'
        return context

```

Forms:

```auto
class ClientSignInForm(AuthenticationForm):
    def __init__ (self, *args, **kwargs):
        super(ClientSignInForm, self). __init__ (*args, **kwargs)

    email = forms.EmailField(
        widget=forms.EmailInput(attrs={'placeholder': 'E-Mail ...', 'name': 'email', 'id': 'email'}),
        label='E-Mail Address')
    password = forms.CharField(
        widget=forms.PasswordInput(attrs={'placeholder': 'Password ...', 'name': 'password', 'id': 'password'}),
        label='Password')

    class Meta:
        model = User
        fields = ['email', 'password']

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 15, 2022, 5:59pm UTC](https://forum.djangoproject.com/t/login-has-no-errors-with-code-200/14303/2 "2022-06-15T17:59:56Z")

</div>

The AuthenticationForm is not a model form - those form fields are not associated with a model.

The authentication being performed on the input from that form is done on a field named `username`, not `email`. That’s the name you would need to use for your field. (Remember, this is _not_ a reference to a model, it’s just the name of the field in the form.)

Likewise, since this is a Form and not a ModelForm, your `Meta` class isn’t doing anything. It’s not a model form with system-created fields.

Review django.contrib.auth.forms.AuthenticationForm to understand how it works.
