Skip to main content

Posts

Showing posts from July, 2020

How to create user-register form,login,logout and also make a profile of each user register in Django?

Django provides a quite easy way to create a User-Registration as all are already presents in the Django we just know how to use this..Here, we will see how to easily implement this and create a profile of all users which are register.This article will be an interesting and important so please read out seriously. firstly we have to start a project and than start an app:     django-admin startproject user-authentication     $ cd user-authentication     $ python manage.py startapp users Once we have created an app we have to add this app in the INSTALLED_APPS  in settings.py. Than we have to add the path of the accounts app: "main project urls.py" from  django.contrib  import  admin from  django.urls  import  path,include from  django.conf  import  settings from  django.conf.urls.static  import  static from  users  import  views  as  user_views from  ...

WHAT IS DJANGO AUTHENTICATION?AND HOW TO MANUALLY WRITE THE CODE FOR THE SIGNUP, LOGIN AND LOGOUT?

In this post we see how to manually write the code for the user Registeration , Login and Logout. firstly we have to start a project and than start an app:      django-admin startproject user-authentication     $ cd user-authentication     $ python manage.py startapp accounts Once we have created an app we have to add this app in the INSTALLED_APPS  in settings.py. Than we have to add the path of the accounts app: "main project urls.py" from  django.contrib  import  admin from  django.urls  import  path,include from  django.conf  import  settings urlpatterns = [     path( 'accounts/' ,include( 'accounts.urls' )),     path( 'admin/' , admin.site.urls), ] if  settings.DEBUG:     urlpatterns=urlpatterns+static(settings.MEDIA_URL, document_root =           settings.MEDIA_ROOT)   ...