问题描述
我有一些有关用户的数据,例如名字,姓氏和电子邮件。现在,我试图在浏览器上查看它。但是它的订购号完全是奇怪的。
我的模板代码
<!DOCTYPE html>
{% load static %}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>User List</title>
<link rel="stylesheet" href="{% static "css/mystyle.css" %}">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1> Here is yours users: </h1>
{% if user_info %}
<ol>
{% for user in user_info %}
<li>{{ user.first_name }}</li>
<ul>
<li>First Name: {{ user.first_name }}</li>
<li>Last Name: {{ user.last_name }}</li>
<li>Email: {{ user.email }}</li>
</ul>
{% endfor %}
</ol>
{% endif %}
</div>
</body>
</html>
我的查看代码
def userlist(request):
user_info = UserInfo.objects.all()
content = {
"user_info":user_info,}
print("User List")
return render(request,"practiceApp/user-list.html",context=content)
我的浏览器:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)