-1
<form method="POST" class="container is-responsive">
    {% csrf_token %}

    <h1><font color="black">Log in</font></h1>
    <label for="username"><font color="black"><b>Email</b></font></label>
    <p><font color="black"> {{ form.username}}</font></p>

    <label for="psw"><font color="black">Password</font></label>
    <p><font color="black">{{ form.password}}</font></p>

    <button type="submit" class="btn">Login</button>
    {% if form.errors %}
    <p><font color="red"><b>Invalid username or password.</b> Please try again.</font></p>
    {% endif %}
</form>

need to add place holders for the default form.username and form.password fields

burns0907
  • 116
  • 1
  • 9
  • Possible duplicate of [How to add class, id, placeholder attributes to a field in django model forms](https://stackoverflow.com/questions/19489699/how-to-add-class-id-placeholder-attributes-to-a-field-in-django-model-forms) – Selcuk Oct 18 '18 at 01:06

1 Answers1

0

you can do this using jquery. add this inside head tag.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" >
$(document).ready(function(){
    $("#id_username").attr('placeholder', 'Enter Email Address to continue');
    $("#id_password").attr('placeholder', 'Enter password to continue');
});
burns0907
  • 116
  • 1
  • 9