{"id":4291,"date":"2023-04-06T15:30:19","date_gmt":"2023-04-06T10:00:19","guid":{"rendered":"https:\/\/learntube.ai\/blog\/?p=4291"},"modified":"2023-04-06T15:30:22","modified_gmt":"2023-04-06T10:00:22","slug":"how-to-use-djangos-built-in-authentication-system","status":"publish","type":"post","link":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/","title":{"rendered":"How to Use Django&#8217;s Built-in Authentication System"},"content":{"rendered":"\n<p>Django is a high-level web framework that follows the Model-View-Controller (MVC) architectural pattern. One of the most useful features of Django is its built-in authentication system, which provides a secure way to handle user authentication and authorization. In this blog post, we&#8217;ll discuss how to use Django&#8217;s built-in authentication system.<\/p>\n\n\n\n<p><strong>Step 1: Create a Django Project<\/strong><\/p>\n\n\n\n<p>The first step is to create a new Django project. You can use the following command to create a new Django project:<\/p>\n\n\n\n<p>django-admin startproject project_name<\/p>\n\n\n\n<p><strong>Step 2: Create a Django App<\/strong><\/p>\n\n\n\n<p>Next, you&#8217;ll need to create a new Django app inside your project. You can use the following command to create a new Django app:<\/p>\n\n\n\n<p>python manage.py startapp app_name<\/p>\n\n\n\n<p><strong>Step 3: Configure Authentication Settings<\/strong><\/p>\n\n\n\n<p>Before we start using Django&#8217;s built-in authentication system, we need to configure some settings in the settings.py file of your project. Add the following code to the settings.py file:<\/p>\n\n\n\n<p>AUTHENTICATION_BACKENDS = [<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8216;django.contrib.auth.backends.ModelBackend&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8216;allauth.account.auth_backends.AuthenticationBackend&#8217;,<\/p>\n\n\n\n<p>]<\/p>\n\n\n\n<p>AUTH_USER_MODEL = &#8216;app_name.CustomUser&#8217;<\/p>\n\n\n\n<p>LOGIN_REDIRECT_URL = &#8216;\/&#8217;<\/p>\n\n\n\n<p>ACCOUNT_EMAIL_VERIFICATION = &#8216;none&#8217;<\/p>\n\n\n\n<p>This code sets the authentication backends, specifies a custom user model, sets the redirect URL for login, and disables email verification.<\/p>\n\n\n\n<p><strong>Step 4: Create a Custom User Model<\/strong><\/p>\n\n\n\n<p>Now we need to create a custom user model that extends the default Django User model. To do this, create a new file called models.py in your app directory and add the following code:<\/p>\n\n\n\n<p>from django.contrib.auth.models import AbstractUser<\/p>\n\n\n\n<p>class CustomUser(AbstractUser):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;pass<\/p>\n\n\n\n<p><strong>Step 5: Create User Registration Views<\/strong><\/p>\n\n\n\n<p>In Django, a view is a Python function that takes a web request and returns a web response. We need to create two views for user registration, one for the registration form and one for the registration success page.<\/p>\n\n\n\n<p>from django.shortcuts import render, redirect<\/p>\n\n\n\n<p>from django.contrib.auth import authenticate, login<\/p>\n\n\n\n<p>from .forms import RegistrationForm<\/p>\n\n\n\n<p>def registration(request):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if request.method == &#8216;POST&#8217;:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form = RegistrationForm(request.POST)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if form.is_valid():<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user = form.save(commit=False)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.set_password(form.cleaned_data[&#8216;password&#8217;])<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.save()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;username = form.cleaned_data.get(&#8216;username&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password = form.cleaned_data.get(&#8216;password&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user = authenticate(username=username, password=password)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;login(request, user)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return redirect(&#8216;success&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;else:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form = RegistrationForm()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return render(request, &#8216;registration.html&#8217;, {&#8216;form&#8217;: form})<\/p>\n\n\n\n<p>def registration_success(request):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return render(request, &#8216;registration_success.html&#8217;)<\/p>\n\n\n\n<p><strong>Step 6: Create Registration Forms<\/strong><\/p>\n\n\n\n<p>We need to create two forms for user registration, one for the registration form and one for the registration success page. Create a new file called forms.py in your app directory and add the following code:<\/p>\n\n\n\n<p>from django import forms<\/p>\n\n\n\n<p>from .models import CustomUser<\/p>\n\n\n\n<p>class RegistrationForm(forms.ModelForm):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;password = forms.CharField(widget=forms.PasswordInput)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;class Meta:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;model = CustomUser<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fields = [&#8216;username&#8217;, &#8217;email&#8217;, &#8216;password&#8217;]<\/p>\n\n\n\n<p><strong>Step 7: Create Login Views and Templates<\/strong><\/p>\n\n\n\n<p>In Django, we need to create two views for user login, one for the login form and one for the login success page.<\/p>\n\n\n\n<p>from django.shortcuts import render, redirect<\/p>\n\n\n\n<p>from django.contrib.auth import authenticate, login<\/p>\n\n\n\n<p>def user_login(request):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if request.method == &#8216;POST&#8217;:<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;username = request.POST.get(&#8216;username&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password = request.POST.get(&#8216;password<\/p>\n\n\n\n<p><strong>Step 8: Create Login Forms<\/strong><\/p>\n\n\n\n<p>We also need to create a form for the user login. Create a new file called forms.py in your app directory and add the following code:<\/p>\n\n\n\n<p>from django import forms<\/p>\n\n\n\n<p>class LoginForm(forms.Form):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;username = forms.CharField()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;password = forms.CharField(widget=forms.PasswordInput)<\/p>\n\n\n\n<p><strong>Step 9: Create Logout View<\/strong><\/p>\n\n\n\n<p>To logout the user, create a logout view in your views.py file.<\/p>\n\n\n\n<p>from django.contrib.auth import logout<\/p>\n\n\n\n<p>def user_logout(request):<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;logout(request)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return redirect(&#8216;home&#8217;)<\/p>\n\n\n\n<p><strong>Step 10: Add URLs to Your App<\/strong><\/p>\n\n\n\n<p>Add the URLs to your app by creating a new urls.py file in your app directory and adding the following code:<\/p>\n\n\n\n<p>from django.urls import path<\/p>\n\n\n\n<p>from . import views<\/p>\n\n\n\n<p>urlpatterns = [<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;path(&#8216;register\/&#8217;, views.registration, name=&#8217;register&#8217;),<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;path(&#8216;login\/&#8217;, views.user_login, name=&#8217;login&#8217;),<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;path(&#8216;logout\/&#8217;, views.user_logout, name=&#8217;logout&#8217;),<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;path(&#8216;success\/&#8217;, views.registration_success, name=&#8217;success&#8217;),<\/p>\n\n\n\n<p>]<\/p>\n\n\n\n<p><strong>Step 11: Create Templates<\/strong><\/p>\n\n\n\n<p>Create templates for the registration and login forms, as well as the registration and login success pages. Add these templates to your app&#8217;s templates directory.<\/p>\n\n\n\n<p>registration.html:<\/p>\n\n\n\n<p>{% extends &#8216;base.html&#8217; %}<\/p>\n\n\n\n<p>{% block content %}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;Register&lt;\/h2&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;form method=&#8221;POST&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{% csrf_token %}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ form.as_p }}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;button type=&#8221;submit&#8221;&gt;Register&lt;\/button&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/form&gt;<\/p>\n\n\n\n<p>{% endblock %}<\/p>\n\n\n\n<p>login.html:<\/p>\n\n\n\n<p>{% extends &#8216;base.html&#8217; %<\/p>\n\n\n\n<p><strong>Concusion: <\/strong>Django&#8217;s built-in authentication system provides a secure and easy way to handle user authentication and authorization in your web application. By following the steps outlined in this blog post, you can set up user registration, login, and logout functionality in your Django app using the built-in authentication system. Remember to customize your authentication settings and user model to fit your specific needs, and always prioritize security when working with user authentication. With these tips and best practices in mind, you can create a robust and secure authentication system for your Django web application.<\/p>\n\n\n\n<p>If you&#8217;re looking to enhance your expertise in <a href=\"https:\/\/learntube.ai\/programming-courses\/django-basic-course\">Django<\/a>, LearnTube has got you covered with an array of online courses tailored to your needs. With the help of our specialized learning app and WhatsApp bot, you can enjoy a seamless learning experience. Our platform offers an extensive range of courses that cater to both novices and seasoned learners. For valuable insights, explore our diverse selection of courses on our <a href=\"https:\/\/learntube.ai\/\">website<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Django is a high-level web framework that follows the Model-View-Controller (MVC) architectural pattern. One of the most useful features of Django is its built-in authentication system, which provides a secure way to handle user authentication and authorization. In this blog post, we&#8217;ll discuss how to use Django&#8217;s built-in authentication system. Step 1: Create a Django [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[99],"tags":[],"class_list":{"0":"post-4291","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-django"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Django&#039;s Built-in Authentication System - Learn Tube<\/title>\n<meta name=\"description\" content=\"Explore Django&#039;s built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Django&#039;s Built-in Authentication System - Learn Tube\" \/>\n<meta property=\"og:description\" content=\"Explore Django&#039;s built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Tube\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CareerNinjaIndia\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-06T10:00:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T10:00:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"427\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Team LearnTube\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team LearnTube\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\"},\"author\":{\"name\":\"Team LearnTube\",\"@id\":\"https:\/\/learntube.ai\/blog\/#\/schema\/person\/0f4e519a2115e9be9c8083e7a41a4e07\"},\"headline\":\"How to Use Django&#8217;s Built-in Authentication System\",\"datePublished\":\"2023-04-06T10:00:19+00:00\",\"dateModified\":\"2023-04-06T10:00:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\"},\"wordCount\":1163,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/learntube.ai\/blog\/#organization\"},\"articleSection\":[\"Django\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\",\"url\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\",\"name\":\"How to Use Django's Built-in Authentication System - Learn Tube\",\"isPartOf\":{\"@id\":\"https:\/\/learntube.ai\/blog\/#website\"},\"datePublished\":\"2023-04-06T10:00:19+00:00\",\"dateModified\":\"2023-04-06T10:00:22+00:00\",\"description\":\"Explore Django's built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.\",\"breadcrumb\":{\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learntube.ai\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Django&#8217;s Built-in Authentication System\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learntube.ai\/blog\/#website\",\"url\":\"https:\/\/learntube.ai\/blog\/\",\"name\":\"LearnTube\",\"description\":\"10000+ Free Courses with Free Certification and doubt solving -\",\"publisher\":{\"@id\":\"https:\/\/learntube.ai\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learntube.ai\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learntube.ai\/blog\/#organization\",\"name\":\"LearnTube\",\"url\":\"https:\/\/learntube.ai\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learntube.ai\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2022\/04\/1645302407Colourpng.png\",\"contentUrl\":\"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2022\/04\/1645302407Colourpng.png\",\"width\":3000,\"height\":742,\"caption\":\"LearnTube\"},\"image\":{\"@id\":\"https:\/\/learntube.ai\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/CareerNinjaIndia\/\",\"https:\/\/www.instagram.com\/careerninjaindia\/\",\"https:\/\/www.linkedin.com\/company\/careerninja\/\",\"https:\/\/www.youtube.com\/c\/CareerNinja\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/learntube.ai\/blog\/#\/schema\/person\/0f4e519a2115e9be9c8083e7a41a4e07\",\"name\":\"Team LearnTube\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learntube.ai\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2f280aa676ba5daf1e7407bffa25f05d95bb67811711176adde8cf8440982486?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2f280aa676ba5daf1e7407bffa25f05d95bb67811711176adde8cf8440982486?s=96&d=mm&r=g\",\"caption\":\"Team LearnTube\"},\"sameAs\":[\"https:\/\/learntube.ai\/blog\"],\"url\":\"https:\/\/learntube.ai\/blog\/author\/team-learntube\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Django's Built-in Authentication System - Learn Tube","description":"Explore Django's built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Django's Built-in Authentication System - Learn Tube","og_description":"Explore Django's built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.","og_url":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/","og_site_name":"Learn Tube","article_publisher":"https:\/\/www.facebook.com\/CareerNinjaIndia\/","article_published_time":"2023-04-06T10:00:19+00:00","article_modified_time":"2023-04-06T10:00:22+00:00","og_image":[{"width":640,"height":427,"url":"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg","type":"image\/jpeg"}],"author":"Team LearnTube","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Team LearnTube","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#article","isPartOf":{"@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/"},"author":{"name":"Team LearnTube","@id":"https:\/\/learntube.ai\/blog\/#\/schema\/person\/0f4e519a2115e9be9c8083e7a41a4e07"},"headline":"How to Use Django&#8217;s Built-in Authentication System","datePublished":"2023-04-06T10:00:19+00:00","dateModified":"2023-04-06T10:00:22+00:00","mainEntityOfPage":{"@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/"},"wordCount":1163,"commentCount":0,"publisher":{"@id":"https:\/\/learntube.ai\/blog\/#organization"},"articleSection":["Django"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/","url":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/","name":"How to Use Django's Built-in Authentication System - Learn Tube","isPartOf":{"@id":"https:\/\/learntube.ai\/blog\/#website"},"datePublished":"2023-04-06T10:00:19+00:00","dateModified":"2023-04-06T10:00:22+00:00","description":"Explore Django's built-in authentication system and learn how to add user authentication to your web application. Secure your app with Django today.","breadcrumb":{"@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learntube.ai\/blog\/programming\/django\/how-to-use-djangos-built-in-authentication-system\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learntube.ai\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Django&#8217;s Built-in Authentication System"}]},{"@type":"WebSite","@id":"https:\/\/learntube.ai\/blog\/#website","url":"https:\/\/learntube.ai\/blog\/","name":"LearnTube","description":"10000+ Free Courses with Free Certification and doubt solving -","publisher":{"@id":"https:\/\/learntube.ai\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learntube.ai\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/learntube.ai\/blog\/#organization","name":"LearnTube","url":"https:\/\/learntube.ai\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learntube.ai\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2022\/04\/1645302407Colourpng.png","contentUrl":"https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2022\/04\/1645302407Colourpng.png","width":3000,"height":742,"caption":"LearnTube"},"image":{"@id":"https:\/\/learntube.ai\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CareerNinjaIndia\/","https:\/\/www.instagram.com\/careerninjaindia\/","https:\/\/www.linkedin.com\/company\/careerninja\/","https:\/\/www.youtube.com\/c\/CareerNinja"]},{"@type":"Person","@id":"https:\/\/learntube.ai\/blog\/#\/schema\/person\/0f4e519a2115e9be9c8083e7a41a4e07","name":"Team LearnTube","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learntube.ai\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2f280aa676ba5daf1e7407bffa25f05d95bb67811711176adde8cf8440982486?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2f280aa676ba5daf1e7407bffa25f05d95bb67811711176adde8cf8440982486?s=96&d=mm&r=g","caption":"Team LearnTube"},"sameAs":["https:\/\/learntube.ai\/blog"],"url":"https:\/\/learntube.ai\/blog\/author\/team-learntube\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"thumbnail":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-150x150.jpg",150,150,true],"medium":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-300x200.jpg",300,200,true],"medium_large":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"large":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"1536x1536":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"2048x2048":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"td_218x150":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-218x150.jpg",218,150,true],"td_324x400":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-324x400.jpg",324,400,true],"td_485x360":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-485x360.jpg",485,360,true],"td_696x0":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"td_1068x0":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"td_1920x0":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269.jpg",640,427,false],"td_324x235":["https:\/\/learntube.ai\/blog\/wp-content\/uploads\/2023\/04\/pexels-christina-morillo-1181269-324x235.jpg",324,235,true]},"uagb_author_info":{"display_name":"Team LearnTube","author_link":"https:\/\/learntube.ai\/blog\/author\/team-learntube\/"},"uagb_comment_info":2,"uagb_excerpt":"Django is a high-level web framework that follows the Model-View-Controller (MVC) architectural pattern. One of the most useful features of Django is its built-in authentication system, which provides a secure way to handle user authentication and authorization. In this blog post, we&#8217;ll discuss how to use Django&#8217;s built-in authentication system. Step 1: Create a Django&hellip;","_links":{"self":[{"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/posts\/4291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/comments?post=4291"}],"version-history":[{"count":1,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/posts\/4291\/revisions"}],"predecessor-version":[{"id":4293,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/posts\/4291\/revisions\/4293"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/media\/4292"}],"wp:attachment":[{"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/media?parent=4291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/categories?post=4291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learntube.ai\/blog\/wp-json\/wp\/v2\/tags?post=4291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}