| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- {% extends "base.html" %}
- {% load static %}
- {% block title %}
- 发表文章
- {% endblock title %}
- {% block content %}
- <div class="container">
- <div class="row">
- <div class="col-12">
- <br>
- <!-- 提交文章的表单 -->
- <form method="post" action=".">
- <!-- Django中需要POST数据的地方都必须有csrf_token -->
- {% csrf_token %}
- <div class="form-group">
- <label for="title">
- 文章标题
- </label>
- <input type="text" class="form-control" id="title" name="title">
- </div>
- <!--文章类别-->
- <div class="form-group">
- <label for="column">分类</label>
- <select class="form-control"
- id="column"
- name="column"
- >
- <option value="none">请选择分类..</option>
- {% for column in columns %}
- <option value="{{ column.id }}">{{ column }}</option>
- {% endfor %}
- </select>
- </div>
- <div class="form-group">
- <label for="tags">
- 文章标签
- </label>
- <input type="text" class="form-control col-3" id="tags" name="tags">
- </div>
- <div class="form-group">
- <label for="body">
- 文章正文
- </label>
- <textarea type="text" class="form-control" id="body" name="body" rows="12">
- </textarea>
- </div>
- <button type="submit" class="btn btn-primary">
- 完成
- </button>
- </form>
- </div>
- </div>
- </div>
- {% endblock content %}
|