X
X
xxx2017-09-06 12:23:33
Django
xxx, 2017-09-06 12:23:33

Customize django.contrib.auth.views.login form?

Good afternoon. There is a template with the styles connected to it. I want to customize django.contrib.auth.views.login form .

<form class="form">
      <input type="text" placeholder="Username">
      <input type="password" placeholder="Password">
      <button type="submit" id="login-button">Login</button>
    </form>

I know that I need to add
{{ form.username }}
{{ form.password }}
How to correctly assign a button and how to add placeholder to fields ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Astrohas, 2017-09-06
@Astrohas

<form class="form" method="POST" action="адрес куда нужно отправить">
      {% csrf_token %}
      <input type="text" placeholder="Логин" name="username">
      <input type="password" placeholder="Пароль" name="password">
      <button type="submit" id="login-button">Зайти</button>
</form>

So ©
ps Please specify what exactly you have problems with

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question