Django show render_to_response in template

泪湿孤枕 提交于 2019-12-05 10:15:11

Well, it looks like your template is rendering fine. So you'll have to see if draft_list actually contained anything and what playernumber is for each object that was grabbed.

In the root directory of your project, run:

python manage.py shell

Now that you're in the shell, to test whether there are actually any Player objects in your database and see what the playernumber property of each object returns:

from acme.acmetest.models import Player
draft_list = Player.objects.all()
for draft in draft_list:
    print draft.playernumber

Make sure that makepick.hmtl is in your apps templates directory, or in your TEMPLATE_DIR.

You can check in your view to verify that Player.objects.all() is actually returning something. Make sure playernumber is an actual property of the Player object.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!