views.py 885 B

12345678910111213141516171819202122232425262728293031323334
  1. from django.shortcuts import render
  2. from django.shortcuts import HttpResponse
  3. # Create your views here.
  4. # def robot(request):
  5. # html = '<html><body>家用机器人</body></html>'
  6. # return HttpResponse(html)
  7. # def monitoring(request):
  8. # html = '<html><body>智能监控</body></html>'
  9. # return HttpResponse(html)
  10. # def face(request):
  11. # html = '<html><body>人脸识别解决方案</body></html>'
  12. # return HttpResponse(html)
  13. def products(request,productName):
  14. submenu=productName
  15. if productName=='robot':
  16. productName='家用机器人'
  17. elif productName=='monitor':
  18. productName='智能监控'
  19. else:
  20. productName='人脸识别解决方案'
  21. return render(
  22. request,'productList.html',{
  23. 'active_menu':'products',
  24. 'sub_menu':submenu,
  25. "productName":productName,
  26. }
  27. )