示例#1
0
def checkFBLogin(request):
    if request.method == 'POST':
        femail = request.POST.get('email')
        fname = request.POST.get('name')
        fid = request.POST.get('id')
        login = Login.objects.filter(email=femail)
        if login:
            set_session(request, login)
        else:
            login_object = Login(email = femail, password = None)
            login_object.save()
            profile_pic_str = 'http://graph.facebook.com/' + fid + '/picture?type=large'
            user_object = Users(login = login_object, name = fname, profile_pic = profile_pic_str)
            user_object.save()
            set_session_obj(request, login_object)

        return HttpResponse("logged_in")
    else:
         return HttpResponse("not_logged_in")
示例#2
0
def checkFBLogin(request):
    if request.method == 'POST':
        femail = request.POST.get('email')
        fname = request.POST.get('name')
        fid = request.POST.get('id')
        login = Login.objects.filter(email=femail)
        if login:
            set_session(request, login)
        else:
            login_object = Login(email=femail, password=None)
            login_object.save()
            profile_pic_str = 'http://graph.facebook.com/' + fid + '/picture?type=large'
            user_object = Users(login=login_object,
                                name=fname,
                                profile_pic=profile_pic_str)
            user_object.save()
            set_session_obj(request, login_object)

        return HttpResponse("logged_in")
    else:
        return HttpResponse("not_logged_in")
示例#3
0
 def save(self):
     data = self.cleaned_data
     login = Login(email=data['email'],password=data['password'])
     l=login.save()
     return login
 def save(self):
     data = self.cleaned_data
     login = Login(email=data['email'], password=data['password'])
     l = login.save()
     return login