我已经创建了一个应用程序,其中包含作为登录页的第一页。我希望在应用程序中的每个页面都输入emailid

2024-10-03 09:17:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经创建了一个应用程序,其中包含作为登录页面的第一页。我的问题是,我想在登录到应用程序的每个页面时显示输入的emailid。如果我将emailid声明为全局,则会引发错误。如果你有什么把戏,请告诉我。 谢谢你

def loginbmtool(request):
    emailid=request.POST["emailid"]
    password=request.POST["password"]
    if(str(emailid) == "brisatechnology@gmail.com" and str(password) == "hellobrisa123"):
        msg ="" +emailid
        return  render_to_response('admin.html',{'msg':msg})
##    if(str(emailid) != "brisatechnology@gmail.com" and str(password) = "brisa123"):
##         msg ="" +emailid
##         return  render_to_response('login.html',{'wrong_user':'wrong emailid or password'})
    else:
        print "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        db=validate()
        flag1=db.ValidateUser_Authentication(emailid,password)
        if(flag1=="true"):


            msg ="" +emailid
            db=Fetch()
            list1=db.pendinginvoice()
            list2=db.delayedpay()
            countofpo=db.NewPOs()
            countofinvoice=db.invoicenocount()
            countofacc,m,y=db.NewAccounts()
            y=" "+y
            mon=int(m)
            listofmnth=[]
            listofmnth=['January','February','March','April','May','June','July','August','September','October','November','December']
            month=listofmnth[mon-1]
            expiringPO=db.ExpiringPO()

            print "\ncountofpo",countofpo
            print list2
            print list1
            print list2
            return render_to_response("index.html",{'msg':msg,"month":month,"year":y,"countofacc":countofacc,"expiringPO":expiringPO,"countofinvoice":countofinvoice,"countofpo":countofpo,"list1":list1,"list2":list2,"msg":msg})
        else:

            return render_to_response('login.html',{'wrong_user':'emailid or password you entered is incorrect?'})

Tags: todbreturnresponserequesthtmlmsgpassword