create.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {% extends "base.html" %}
  2. {% load static %}
  3. {% block title %}
  4. 发表文章
  5. {% endblock title %}
  6. {% block content %}
  7. <div class="container">
  8. <div class="row">
  9. <div class="col-12">
  10. <br>
  11. <!-- 提交文章的表单 -->
  12. <form method="post" action=".">
  13. <!-- Django中需要POST数据的地方都必须有csrf_token -->
  14. {% csrf_token %}
  15. <div class="form-group">
  16. <label for="title">
  17. 文章标题
  18. </label>
  19. <input type="text" class="form-control" id="title" name="title">
  20. </div>
  21. <div class="form-group">
  22. <label for="body">
  23. 文章正文
  24. </label>
  25. <textarea type="text" class="form-control" id="body" name="body" rows="12">
  26. </textarea>
  27. </div>
  28. <button type="submit" class="btn btn-primary">
  29. 完成
  30. </button>
  31. </form>
  32. </div>
  33. </div>
  34. </div>
  35. {% endblock content %}