`from django.shortcuts import render,redirect, HttpResponse` `from user_login_app.models import UserNormally the .get function highlights as the .all function does, also displays the logged in user onNo I get nothing from Session. To be clear, I also made all<
我试图在我的web模板中使用代码优先方法来设置我的数据库。end of Updated_At as well我还有下面的类,用于为数据库添加种子。SeedDatabase函数,如果数据库在启动时不包含任何数据,该函数基本上是种子。问题:问题我正在讨论的问题是,当我第一次启动我的开发服务器时,应用程序会注意到数据库不包含任何值,所以它尝试将其种子化。有人能告诉我为什么<
我是Django框架的新手,我似乎无法确定为什么我的detail.html没有正确地呈现。看来,我在question.choice_set.all中迭代而不是选择的for循环似乎没有被击中。如果有人能帮我找出为什么会很有帮助。'polls:vote' question.id %}" method="post">
{% for choice in question.choice_s