Part -9

Authenticate Users In Django

from django.contrib.auth import views as auth_views
{%extends ‘blogapp/base.html’%}
<form method='POST'>
<button type='submit'>Submit</button>
Need An Account? <a href='{%url 'register'%}'>Sign Up</a></form>
path('logout/',auth_views.LogoutView.as_view(template_name="users/logout.html"),name='logout'),{% extends "blogapp/base.html" %}
{% block body %}
<h2>You have been logged out</h2>
<a href="{% url 'login' %}">Log In Again</a>
{% endblock body %}

Posting Django Tutorials with Beginner to Advanced Projects

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store