Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.html 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {% extends "base.html" %}
  2. {% block content %}
  3. {% if form.errors %}
  4. <p>Your username and password didn't match. Please try again.</p>
  5. {% endif %}
  6. {% if next %}
  7. {% if user.is_authenticated %}
  8. <p>Your account doesn't have access to this page. To proceed, please login with an account that has access.</p>
  9. {% else %}
  10. <p>Please login to see this page.</p>
  11. {% endif %}
  12. {% endif %}
  13. <form method="post" action="{% url 'login' %}">
  14. {% csrf_token %}
  15. <div>
  16. <td>{{ form.username.label_tag }}</td>
  17. <td>{{ form.username }}</td>
  18. </div>
  19. <div>
  20. <td>{{ form.password.label_tag }}</td>
  21. <td>{{ form.password }}</td>
  22. </div>
  23. <div>
  24. <input type="submit" value="login" class="btn btn-lg btn-primary"/>
  25. <input type="hidden" name="next" value="{{ next }}" />
  26. </div>
  27. </form>
  28. <div>
  29. <div class="row">
  30. <div class="col-md-8">
  31. <div>
  32. {% for post in posts %}
  33. <div class="mt-5 post">
  34. <div class="date">
  35. {{ post.published_date }}
  36. </div>
  37. <h2>
  38. <a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
  39. </h2>
  40. <p>{{ post.text|linebreaks }}</p>
  41. Tags: {% for tag in post.tags.all %}
  42. <a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
  43. {% if not forloop.last %}, {% endif %} {% endfor %} <p>
  44. {{ post.author }}
  45. </p>
  46. </div>
  47. {% endfor %}
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. {% endblock %}