0
Start my session
request.session['username'] = 'usuario'
request.session['password'] = 'senha'
Here is the following, if there is a session username, password and there is no session Challenge, i would like you to take the database data by the username that is open. (my case the session name is user same)
def gender(request):
if request.session.get('username') and request.session.get('password') and not request.session.get('challenge'):
a = User.objects.all()
return render(request, 'gender/gender.html', {'a': a})
return redirect('home')
Summarizing the code above, if gender equals = 1 redirects to home if it is 0 choice.
But you’re getting all the data from the database, I’d just like my session