Задать вопрос

Тел: +7 965 3737 888

500

Просмотров

1

Ответов

Facebook Connect Middleware

This middleware will look for the cookies set when a Facebook Connect user authenticates to your site, read those cookies, determine if the logged in user is your Facebook friend and then log that user into your Django-powered site.

If you don't need the bit about friend verification, it should be trivial to strip out.

There are a couple of other things that are needed to get FB Connect working with your site, and you can find a more detailed entry here (http://nyquistrate.com/django/facebook-connect/).

Вопрос полезен? Да0/Нет0
file_3449.py(11.2Кб)
None

Ответы (1):

Ответdashasalo:03.01.2010
Ответ полезен? Да0/Нет0

This code works perfectly well except when FB granted you infinite session key. In this case session expires field is set to 0.

I suggest updating the following line

if(datetime.fromtimestamp(float(request.COOKIES[API_KEY+'_expires'])) > datetime.now()):

with check for float(request.COOKIES[API_KEY+'_expires'])==0.