set is_staff to true to Account model in django model after that save method will be called
On Wed, Aug 1, 2018 at 1:06 PM, lalitaquasoft <lalitaquasoft@gmail.com> wrote:
--Advance Thanks for your help:is_staff value is not save in databaseHere is Code:from django.contrib.auth import login, authenticatefrom django.shortcuts import render, redirectfrom blog.forms import SignUpFormdef signup(request):if request.method == 'POST':form = SignUpForm(request.POST)if form.is_valid():form.is_staff = 1form.save()# username = form.cleaned_data.get('username') # raw_password = form.cleaned_data.get('password1') # user = authenticate(username=username, password=raw_password) # login(request, user)# return redirect('home')else:form = SignUpForm()return render(request, 'register.html', {'form': form})
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+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54a3c692- .3232-4032-aadd-561789b92c91% 40googlegroups.com
For more options, visit https://groups.google.com/d/optout .
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABuXbh-CTnYG%2BGWQXDU9o%3D1VnrNCtCzfksH%2B50M55%3Dw2Rh6Z5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment