Thanks for the reply. Actually, really dumb mistake, of course. I was
using the default django login view to authenticate, which means that
my view called "login" was never storing the session value! Once I
used my own login view, I was able to store my values correctly.
On Sep 7, 5:11 am, bruno desthuilliers <bruno.desthuilli...@gmail.com>
wrote:
> On Sep 6, 10:42 am, alaric <foster.cr...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi:
> > I am very new to Django but I am trying to authenticate using Django's
> > session framework.
> > Problem is: I need the raw password to ssh as that user to retrieve
> > data on another machine. I haven't gotten it to work however.
>
> > I have a login view that looks like:
>
> > def login(request):
> > request.session['blah']=request.POST['username']
> > request.session['blah2']=request.POST['password']
>
> > <snip>
>
> > def view_data(request):
> > username=request.session['blah']
> > password=request.session['blah2']
> > <snip>
>
> > I get KeyError with view_data. Am I missing something here?
>
> Is your session correctly configured ?https://docs.djangoproject.com/en/1.3/topics/http/sessions/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment