{% csrf_token %} <!-- <div class="mb-3"> <label for="titleId" class="form-label">Title</label> {% if errors.title %} <p class="form-error">{{ errors.title }}</p> <input type="text" name="title" class="form-control field-error" id="titleId" aria-describedby="title" value="{{ article.title }}"> {%else%} <input type="text" name="title" class="form-control" id="titleId" aria-describedby="title" value="{{ article.title }}"> {%endif%} </div> <div class="mb-3"> <label for="statusId" class="form-label">Status</label> <select name="status" id="statusId" class="form-select"> {% for choice in status_choices %} {% if article.status == choice.0 %} <option value="{{ choice.0 }}" selected>{{ choice.1 }}</option> {% else %} <option value="{{ choice.0 }}">{{ choice.1 }}</option> {% endif %} {% endfor %} </select> </div> <div class="mb-3"> <label for="textId" class="form-label">Text</label> {% if errors.text %} <p class="form-error">{{ errors.text }}</p> <textarea name="text" class="form-control field-error" id="textId" cols="30" rows="10">{{article.text}}</textarea> {% else %} <textarea name="text" class="form-control" id="textId" cols="30" rows="10">{{article.text}}</textarea> {%endif%} </div> <div class="mb-3"> <label for="authorId" class="form-label">Author</label> {% if errors.author %} <p class="form-error">{{ errors.author }}</p> <input type="text" name="author" class="form-control field-error" id="authorId" aria-describedby="author" value="{{article.author}}"> {%else%} <input type="text" name="author" class="form-control" id="authorId" aria-describedby="author" value="{{article.author}}"> {%endif%} </div> --> {% for error in form.non_field_errors %} <p class="form-error">{{error}}</p> {%endfor%} <p><label for="{{form.title.id_for_label}}">{{form.title.label}}</label></p> {% for error in form.title.errors %} <p class="form-error"> {{ error }} </p> {% endfor %} <p>{{ form.title }}</p> <p><label for="{{form.author.id_for_label}}">{{form.author.label}}</label></p> {% for error in form.author.errors %} <p class="form-error"> {{ error }} </p> {% endfor %} <p>{{ form.author }}</p> <p><label for="{{form.status.id_for_label}}">{{form.status.label}}</label></p> {% for error in form.status.errors %} <p class="form-error"> {{ error }} </p> {% endfor %} <p>{{ form.status }}</p> <p><label for="{{form.text.id_for_label}}">{{form.text.label}}</label></p> {% for error in form.text.errors %} <p class="form-error"> {{ error }} </p> {% endfor %} <p>{{ form.text }}</p> <button type="submit" class="btn btn-primary">{{ button_text }}</button>