2014-09-23 73 views
0

我已經創建了一個包含第一頁作爲登錄頁面的應用程序。我的問題是,我想在登錄我的應用程序的每個頁面時顯示輸入的emailid。如果我將emailid聲明爲全局錯誤。如果你有任何問題,請告訴我。 謝謝你!我已經創建了一個包含第一頁作爲登錄頁面的應用程序。我想在應用程序中的每個頁面輸入emailid

def loginbmtool(request): 
    emailid=request.POST["emailid"] 
    password=request.POST["password"] 
    if(str(emailid) == "[email protected]" and str(password) == "hellobrisa123"): 
     msg ="" +emailid 
     return render_to_response('admin.html',{'msg':msg}) 
## if(str(emailid) != "[email protected]" 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?'}) 

回答

相關問題