Re: User log in authentication problem in Django

2023-07-31 Thread AYUSH GUPTA
Why u create registration model for authentication because authentication
model already included when u run command make migrations.
U only import django.contrib.auth import User, authenticate and use

On Sun, Jul 30, 2023, 7:02 AM Mh Limon  wrote:

> This is my views.py code. when providing the correct username and
> password, the system consistently displays an error message stating "You
> have incorrect Username or password."
> from django.shortcuts import render,HttpResponse,redirect
> from .models import registration
> from django.contrib.auth import authenticate,login
>
> def home(request):
> return render(request,'home.html')
>
> def log_in(request):
> if request.method == 'POST':
> username = request.POST.get('username')
> password = request.POST.get('password')
>
> user = authenticate(request, username=username, password=password)
>
> if user is not None:
> login(request, user)
> return redirect('home')
> else:
> return HttpResponse("You have incorrect Username or password")
>
> return render(request, 'log_in.html')
>
>
> def sign_up(request):
> if request.method == 'POST':
> name = request.POST.get('fullname')
> username = request.POST.get('username')
> email = request.POST.get('email')
> pass1 = request.POST.get('password')
> pass2 = request.POST.get('confirm_password')
>
> if pass1 != pass2:
> return HttpResponse("Password not matched")
> else:
> db = registration()
>
> db.Name = name
> db.username = username
> db.Email = email
> db.Password = pass1
>
> db.save()
>
> return redirect('log_in')
>
>
> return render(request,'sign_up.html')
>
> This is models.py for SQLite database:
> from django.db import models
>
> class registration(models.Model):
> Name = models.CharField(max_length=100)
> username = models.CharField(max_length=100)
> Email = models.CharField(max_length=100)
> Password = models.CharField(max_length=100)
>
> Please help me for solve this problem
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6c32ddf-746b-43a8-87dc-2ab27721c107n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAr4ktSzS6rudsee_4MpUQucXCT9%2Brn2XW%3DpxSUtWnhaupgS4Q%40mail.gmail.com.


Ynt: User log in authentication problem in Django

2023-07-31 Thread Serkan Gülten
Password should be hash not just string Windows için Posta ile gönderildi Kimden: Mh LimonGönderilme: 30 Temmuz 2023 Pazar 04:32Kime: Django usersKonu: User log in authentication problem in Django This is my views.py code. when providing the correct username and password, the system consistently displays an error message stating "You have incorrect Username or password."from django.shortcuts import render,HttpResponse,redirectfrom .models import registrationfrom django.contrib.auth import authenticate,login def home(request):    return render(request,'home.html') def log_in(request):    if request.method == 'POST':        username = request.POST.get('username')        password = request.POST.get('password')         user = authenticate(request, username=username, password=password)         if user is not None:            login(request, user)            return redirect('home')        else:            return HttpResponse("You have incorrect Username or password")     return render(request, 'log_in.html') def sign_up(request):    if request.method == 'POST':        name = request.POST.get('fullname')        username = request.POST.get('username')        email = request.POST.get('email')        pass1 = request.POST.get('password')        pass2 = request.POST.get('confirm_password')         if pass1 != pass2:            return HttpResponse("Password not matched")        else:            db = registration()             db.Name = name            db.username = username            db.Email = email            db.Password = pass1             db.save()             return redirect('log_in')     return render(request,'sign_up.html') This is models.py for SQLite database: from django.db import models class registration(models.Model):    Name = models.CharField(max_length=100)    username = models.CharField(max_length=100)    Email = models.CharField(max_length=100)    Password = models.CharField(max_length=100) Please help me for solve this problem -- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d6c32ddf-746b-43a8-87dc-2ab27721c107n%40googlegroups.com. 



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9D2DE621-2F86-4E6F-964A-00705EFF05F3%40hxcore.ol.


Re: Problems in Django login authentication

2023-07-31 Thread Joshua Urasa
To add up..I see others comments told you to abstractUser ... this is when
you need to modify the default user maybe to add up other fields in default
user like age or date but from you code above you didn't abstractUser so
follow my previous comment and am sure you code will work

On Sun, Jul 30, 2023, 11:27 Joshua Urasa  wrote:

> If you use default user there is no need to write your model because is
> there by default so what you need to do create is form.py and inside it
> import usercreationform from then that form import to your view so that to
> handle response and request
>
> On Sun, Jul 30, 2023, 08:34 Prashanth Patelc 
> wrote:
>
>> Use default django user model
>>
>> from django.contrib.auth.models import User
>> # Create your models here.
>> class Registration (models.Model):
>> author = models.ForeignKey(User, on_delete=models.CASCADE)
>>
>> # write your fields here
>>
>>
>>
>> In settings.py
>>
>>
>> AUTH_USER_MODEL = app name . Modelname
>>
>> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari <
>> mdehsan...@gmail.com> wrote:
>>
>>> First extend abstract user model or abstract base user model in your
>>> user model and after that define auth.model in settings.py hope its work
>>>
>>> Sent from my iPhone
>>>
>>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas 
>>> wrote:
>>>
>>> 
>>> Can you login with superuser?
>>>
>>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>>
 Views.py file

 from django.shortcuts import render,HttpResponse,redirect
 from .models import registration
 from django.contrib.auth import authenticate,login

 def home(request):
 return render(request,'home.html')

 def log_in(request):
 if request.method == 'POST':
 username = request.POST.get('username')
 password = request.POST.get('password')

 user = authenticate(request, username=username, password=
 password)

 if user is not None:
 login(request, user)
 return redirect('home')
 else:
 return HttpResponse("You have incorrect Username or
 password")

 return render(request, 'log_in.html')


 def sign_up(request):
 if request.method == 'POST':
 name = request.POST.get('fullname')
 username = request.POST.get('username')
 email = request.POST.get('email')
 pass1 = request.POST.get('password')
 pass2 = request.POST.get('confirm_password')

 if pass1 != pass2:
 return HttpResponse("Password not matched")
 else:
 db = registration()

 db.Name = name
 db.username = username
 db.Email = email
 db.Password = pass1

 db.save()

 return redirect('log_in')


 return render(request,'sign_up.html')

 This is models.py for sqlite database:
 from django.db import models

 class registration(models.Model):
 Name = models.CharField(max_length=100)
 username = models.CharField(max_length=100)
 Email = models.CharField(max_length=100)
 Password = models.CharField(max_length=100)


 when providing the correct username and password, the system
 consistently displays an error message stating "You have incorrect Username
 or password."

 please help me to solve this error.



 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
>>> 
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> 

Ynt: Problems in Django login authentication

2023-07-31 Thread Serkan Gülten
Password should be hash not just string Windows için Posta ile gönderildi Kimden: Mh LimonGönderilme: 30 Temmuz 2023 Pazar 04:32Kime: Django usersKonu: Problems in Django login authentication Views.py file  from django.shortcuts import render,HttpResponse,redirectfrom .models import registrationfrom django.contrib.auth import authenticate,login def home(request):    return render(request,'home.html') def log_in(request):    if request.method == 'POST':        username = request.POST.get('username')        password = request.POST.get('password')         user = authenticate(request, username=username, password=password)         if user is not None:            login(request, user)            return redirect('home')        else:            return HttpResponse("You have incorrect Username or password")     return render(request, 'log_in.html') def sign_up(request):    if request.method == 'POST':        name = request.POST.get('fullname')        username = request.POST.get('username')        email = request.POST.get('email')        pass1 = request.POST.get('password')        pass2 = request.POST.get('confirm_password')         if pass1 != pass2:            return HttpResponse("Password not matched")        else:            db = registration()             db.Name = name            db.username = username            db.Email = email            db.Password = pass1             db.save()             return redirect('log_in')     return render(request,'sign_up.html') This is models.py for sqlite database: from django.db import models class registration(models.Model):    Name = models.CharField(max_length=100)    username = models.CharField(max_length=100)    Email = models.CharField(max_length=100)    Password = models.CharField(max_length=100)  when providing the correct username and password, the system consistently displays an error message stating "You have incorrect Username or password."please help me to solve this error.  -- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com. 



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4D4A2A26-6FAB-4D8C-ABF2-21CBA9B212AC%40hxcore.ol.


Re: Problems in Django login authentication

2023-07-31 Thread Joshua Urasa
If you use default user there is no need to write your model because is
there by default so what you need to do create is form.py and inside it
import usercreationform from then that form import to your view so that to
handle response and request

On Sun, Jul 30, 2023, 08:34 Prashanth Patelc 
wrote:

> Use default django user model
>
> from django.contrib.auth.models import User
> # Create your models here.
> class Registration (models.Model):
> author = models.ForeignKey(User, on_delete=models.CASCADE)
>
> # write your fields here
>
>
>
> In settings.py
>
>
> AUTH_USER_MODEL = app name . Modelname
>
> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari 
> wrote:
>
>> First extend abstract user model or abstract base user model in your user
>> model and after that define auth.model in settings.py hope its work
>>
>> Sent from my iPhone
>>
>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas 
>> wrote:
>>
>> 
>> Can you login with superuser?
>>
>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>
>>> Views.py file
>>>
>>> from django.shortcuts import render,HttpResponse,redirect
>>> from .models import registration
>>> from django.contrib.auth import authenticate,login
>>>
>>> def home(request):
>>> return render(request,'home.html')
>>>
>>> def log_in(request):
>>> if request.method == 'POST':
>>> username = request.POST.get('username')
>>> password = request.POST.get('password')
>>>
>>> user = authenticate(request, username=username, password=
>>> password)
>>>
>>> if user is not None:
>>> login(request, user)
>>> return redirect('home')
>>> else:
>>> return HttpResponse("You have incorrect Username or
>>> password")
>>>
>>> return render(request, 'log_in.html')
>>>
>>>
>>> def sign_up(request):
>>> if request.method == 'POST':
>>> name = request.POST.get('fullname')
>>> username = request.POST.get('username')
>>> email = request.POST.get('email')
>>> pass1 = request.POST.get('password')
>>> pass2 = request.POST.get('confirm_password')
>>>
>>> if pass1 != pass2:
>>> return HttpResponse("Password not matched")
>>> else:
>>> db = registration()
>>>
>>> db.Name = name
>>> db.username = username
>>> db.Email = email
>>> db.Password = pass1
>>>
>>> db.save()
>>>
>>> return redirect('log_in')
>>>
>>>
>>> return render(request,'sign_up.html')
>>>
>>> This is models.py for sqlite database:
>>> from django.db import models
>>>
>>> class registration(models.Model):
>>> Name = models.CharField(max_length=100)
>>> username = models.CharField(max_length=100)
>>> Email = models.CharField(max_length=100)
>>> Password = models.CharField(max_length=100)
>>>
>>>
>>> when providing the correct username and password, the system
>>> consistently displays an error message stating "You have incorrect Username
>>> or password."
>>>
>>> please help me to solve this error.
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re:

2023-07-31 Thread oluwafemi damilola
It'll advice that you add some extra informations to the page, also the
image takes at least 5 seconds to load and the icon is tiny on mobiles

On Mon, 31 Jul 2023, 14:48 marvelous,  wrote:

> Oh ok then I will put that into consideration thank you very much
>
>
>
> Sent from Mail  for
> Windows
>
>
>
> *From: *Ogunlade Stephen Olayide 
> *Sent: *Monday, July 31, 2023 2:11 PM
> *To: *django-users@googlegroups.com
> *Subject: *Re:
>
>
>
> I will prefer you make the About page the home/landing page
>
>
>
> On Mon, Jul 31, 2023 at 2:00 PM marvelous  wrote:
>
>
>
> Hello guys I just finished building out my portfolio and I would
> appreciate if you give me your honest reviews heres the link
>
>
>
> https://marvel-9gdg.onrender.com/
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/D11D5F79-FE3E-43CC-B82F-FA665B0E4414%40hxcore.ol
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANyXpooYQoA2tuytkCFUj1KEpeZOfF5Gcc37cVWHY2eTgHV45w%40mail.gmail.com
> 
> .
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3FA1C223-C03A-483B-9604-9A682730D0C4%40hxcore.ol
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALo4fb_bHyP%3D4nUwarPT52xF2k3XiRxEmhryKgaHhSKG-p-mPw%40mail.gmail.com.


RE:

2023-07-31 Thread marvelous
Oh ok then I will put that into consideration thank you very much Sent from Mail for Windows From: Ogunlade Stephen OlayideSent: Monday, July 31, 2023 2:11 PMTo: django-users@googlegroups.comSubject: Re: I will prefer you make the About page the home/landing page On Mon, Jul 31, 2023 at 2:00 PM marvelous  wrote: Hello guys I just finished building out my portfolio and I would appreciate if you give me your honest reviews heres the link  https://marvel-9gdg.onrender.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/D11D5F79-FE3E-43CC-B82F-FA665B0E4414%40hxcore.ol.-- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANyXpooYQoA2tuytkCFUj1KEpeZOfF5Gcc37cVWHY2eTgHV45w%40mail.gmail.com. 



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3FA1C223-C03A-483B-9604-9A682730D0C4%40hxcore.ol.


Re:

2023-07-31 Thread Ogunlade Stephen Olayide
I will prefer you make the About page the home/landing page

On Mon, Jul 31, 2023 at 2:00 PM marvelous  wrote:

>
>
> Hello guys I just finished building out my portfolio and I would
> appreciate if you give me your honest reviews heres the link
>
>
>
> https://marvel-9gdg.onrender.com/
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/D11D5F79-FE3E-43CC-B82F-FA665B0E4414%40hxcore.ol
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANyXpooYQoA2tuytkCFUj1KEpeZOfF5Gcc37cVWHY2eTgHV45w%40mail.gmail.com.


[no subject]

2023-07-31 Thread marvelous
 Hello guys I just finished building out my portfolio and I would appreciate if you give me your honest reviews heres the link   https://marvel-9gdg.onrender.com/ 



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/D11D5F79-FE3E-43CC-B82F-FA665B0E4414%40hxcore.ol.


Re: Logout time

2023-07-31 Thread Prashanth Patelc
Thank you all.

 Thank you # madhusudan (I got on idea through you shared the code)

On Fri, Jul 28, 2023, 8:16 PM Madhusudhan Reddy 
wrote:

> To get Logout time based on login time,
>
> login time = some thing
>
> logout time = login time + 8 hours
>
> use datetime timedelta module in python,
>
> >>> CODE <<<
> from datetime import datetime, timedelta
> login_time = datetime.now()
> logout_time = login_time + timedelta(hours=8)
> >>> CODE <<<
>
>
>
>
>
>
>
>
>
> On Fri, 28 Jul 2023 at 20:05, Prashanth Patelc 
> wrote:
>
>> Hi all,
>>
>> How to get logout time based on login time in python?
>>
>> I'm storing hour in one column
>> Eg ; hour
>> 8
>> Based on 8 Calculate logout time
>>
>> My login time 10:00:00
>>
>> I need 6: 00:00 (based 8)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMCU6Cpe32Pcs5PAmbx8LDcJzqqPwuhJVzrz%2B%3D67-tEMBychOw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Best regards,
> Madhusudhan
> +91 90007 79457
> Gmail  | LinkedIn
> 
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFwQctLwNxagOX-QKVUdp58gk4px0M_qftqU3rnHayGaJ9BjAw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMCU6CpehgV_0BzNKSRFLZbgTb0z3hSkXQWmSEfK1v11-_oLPA%40mail.gmail.com.


Re: Problems in Django login authentication

2023-07-31 Thread Mh Limon
Thank you all.My problem is solved.

On Sunday, July 30, 2023 at 11:34:43 AM UTC+6 Prashanth Patelc wrote:

> Use default django user model 
>
> from django.contrib.auth.models import User
> # Create your models here.
> class Registration (models.Model):
> author = models.ForeignKey(User, on_delete=models.CASCADE)
> 
> # write your fields here
>
>
>
> In settings.py
>
>
> AUTH_USER_MODEL = app name . Modelname
>
> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari  
> wrote:
>
>> First extend abstract user model or abstract base user model in your user 
>> model and after that define auth.model in settings.py hope its work
>>
>> Sent from my iPhone
>>
>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas  
>> wrote:
>>
>> 
>> Can you login with superuser?
>>
>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>
>>> Views.py file 
>>>
>>> from django.shortcuts import render,HttpResponse,redirect
>>> from .models import registration
>>> from django.contrib.auth import authenticate,login
>>>
>>> def home(request):
>>> return render(request,'home.html')
>>>
>>> def log_in(request):
>>> if request.method == 'POST':
>>> username = request.POST.get('username')
>>> password = request.POST.get('password')
>>>
>>> user = authenticate(request, username=username, password=
>>> password)
>>>
>>> if user is not None:
>>> login(request, user)
>>> return redirect('home')
>>> else:
>>> return HttpResponse("You have incorrect Username or 
>>> password")
>>>
>>> return render(request, 'log_in.html')
>>>
>>>
>>> def sign_up(request):
>>> if request.method == 'POST':
>>> name = request.POST.get('fullname')
>>> username = request.POST.get('username')
>>> email = request.POST.get('email')
>>> pass1 = request.POST.get('password')
>>> pass2 = request.POST.get('confirm_password')
>>>
>>> if pass1 != pass2:
>>> return HttpResponse("Password not matched")
>>> else:
>>> db = registration()
>>>
>>> db.Name = name
>>> db.username = username
>>> db.Email = email
>>> db.Password = pass1
>>>
>>> db.save()
>>>
>>> return redirect('log_in')
>>>
>>>
>>> return render(request,'sign_up.html')
>>>
>>> This is models.py for sqlite database: 
>>> from django.db import models
>>>
>>> class registration(models.Model):
>>> Name = models.CharField(max_length=100)
>>> username = models.CharField(max_length=100)
>>> Email = models.CharField(max_length=100)
>>> Password = models.CharField(max_length=100)
>>>
>>>
>>> when providing the correct username and password, the system 
>>> consistently displays an error message stating "You have incorrect Username 
>>> or password."
>>>
>>> please help me to solve this error.
>>>
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
>>  
>> 
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/080b9766-217a-488b-be58-8f3f6b3662d8n%40googlegroups.com.