Hi All
Am using my own table to let users login to my django site. I don like to
use django admin page, there fore i have created my model and a model form
to register users so that they can login using their username and password.
How can i utilize my function below so that every page is authenticated
using this file?
def mlogin(request):
m = User.objects.get(username=request.POST['username'])
if m.password == request.POST['password']:
request.session['member_id'] = m.id
#return HttpResponse("You're logged in.")
return HttpResponseRedirect("/commTrack/")
else:
return HttpResponse("Your username and password didn't match.")
Or is there any script i can use? I have tried authenticating using the
AUTHENTICATION_BACKENDS but i didn't get it working. May be if there is one
to guide me on how i can set it.
Thanks in advance.
Regards
Denis