Re: django custom authentication

2017-09-15 Thread James Schneider
, However, when i try to access my homepage,i expect it to render my custom login page(login.html). But it always say TemplateDoesNotExist. I also tried putting the template folder inside an app. But the login page doesnt get rendered still. I need help urgently.Thanks The error page should

Re: django custom authentication

2017-09-15 Thread callsamleung
template_name maybe - template_name: The name of a template to display for the view used to log the user in. Defaults to registration/login.html. see: https://docs.djangoproject.com/en/1.8/topics/auth/default/#all-authentication-views news: https://docs.djangoproject.com/en/1.8/ref/tem

django custom authentication

2017-09-13 Thread yingi keme
I have this code in my app view from django.shortcuts import render from django.contrib.auth.decorators import login_required @login_required(login_url="login/") def home(request): return render(request, "home.html") Here also is my project url from django.conf.urls import url, include fr

Django custom Authentication Backend

2017-04-13 Thread ahmadyosr
Hello everyone I've been trying to create a custom Authentication Backend in Django , It worked .. And it returns an authenticated user and It Logs-in successfuly, BUT , whenever I refresh the page or move for another page it just logout ! it doesn't stuck logged in . here's the backend snap :

Re: Django custom authentication

2013-10-24 Thread Praveen Madhavan
I checked for the session cookie... It is getting created, could it be the django version ? I am using django 1.5 and I found few django openid apps not working on 1.5 . On Tuesday, 22 October 2013 20:44:16 UTC+5:30, Praveen Madhavan wrote: > > Tom > > Thanks for the response, here is my view >

Re: Django custom authentication

2013-10-22 Thread Praveen Madhavan
Tom Thanks for the response, here is my view def home(request): if not request.user.is_authenticated(): # I have written my own custom authenticate method that returns an user object user=authenticate(request=request) if not user: return HttpResponseRedir

Re: Django custom authentication

2013-10-22 Thread Tom Evans
On Tue, Oct 22, 2013 at 12:53 PM, Praveen Madhavan wrote: > Hello All, > > I am trying custom authentication with django, I wrote a class and > filled it with the methods authenticate and get_user, I also added this > authentication to the AUTHENTICATION_BACKENDS in settings.py file. > >

Re: Django custom authentication

2013-10-22 Thread François Schiettecatte
Praveen I would check that cookies are being returned from the browser, the session information in stored in them, and did you check that get_user() is returning the user corresponding to the ID? François On Oct 22, 2013, at 7:53 AM, Praveen Madhavan wrote: > Hello All, > > I am trying

Django custom authentication

2013-10-22 Thread Praveen Madhavan
Hello All, I am trying custom authentication with django, I wrote a class and filled it with the methods authenticate and get_user, I also added this authentication to the AUTHENTICATION_BACKENDS in settings.py file. I have called my custom authenticate method and followed it up with