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,
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
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
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,
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
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 workSent from my iPhoneOn 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas wrote:Can you login with superuser?On Sun, Jul 30, 2023, 02:32 Mh Limon
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
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 =
8 matches
Mail list logo