视图.py
def ATMlogin(request,id):
global loginname
loginname=='ATM_login'
if request.method == 'POST':
ATMnumber1=request.POST['ATMnumber']
mobnum1=request.POST['mobnum']
global mobnum
global atmnum
atmnum=ATMnumber1
mobnum=mobnum1
if Customer_details.objects.filter(ATMnumber=ATMnumber1).exists() and ATMLogin.objects.filter(mobnum=mobnum1).exists() :
user_set=Customer_details.objects.all()
for user in user_set.iterator():
if (user.ATMnumber==atmnum):
id=user.id
current_user={id:1}
#current_user=Customer_details.objects.get(id=id)
return render (request,'dashboard.html',{'current_user':current_user})
form=ATMLoginform()
return render (request,'ATM_login.html',{'form':form})
网址.py
from django.urls import path
from . import views
urlpatterns=[
path('',views.login,name='login_option'),
path('savings_login',views.savingsloginform,name='Savings_Login'),
path('ATM_login',views.ATMloginform,name='ATM_Login'),
path('OB_login',views.OBloginform,name='OB_Login'),
path('Register_OB',views.registerOB,name='Register_OB'),
path('dashboard/<int:id>',views.ATMlogin,name='dashboard'),
path('sentsms',views.sendsms,name='sms_sent'),
path('VerifiedDashboard',views.verifiedDashboard,name='Dashboard'),
path('Logout',views.Logout,name='Logout'),
]
**Atmlogin.html**
{% csrf_token %} <img src="{% static 'Images/portrait_black_24dp.svg' %}" alt="" class="icon">{{form.ATMnumber}}<br><br> <img src="{% static 'Images/portrait_black_24dp.svg' %}" alt="" class="icon">{{form.mobnum}}<br><br>
//--> class="fas fa-sign-in-alt"> 登录
伙计们帮助我,我必须尽快完成这个项目...................................................... …………