django ValueError: invalid literal for int() with base 10: ''

前端 未结 2 875
醉酒成梦
醉酒成梦 2021-01-24 03:22

I have an issue with my site, receiving this error pretty often. It\'s the first time i\'ve run into this and maybe someone can shed some light as to why?

Traceb         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-24 04:03

    You need to check URL in your template. you need to pass the integer id to url {{user.id}} because url need to have integer value in template. Ex. url:- /polls/{{user.id}}/

    And in template first check your getting id or not like anywhere in template type sdhajdhgsjgd {{user.id}} kejhksdbjf and check your getting the integer value or not.

    Hope this will work for others.

提交回复
热议问题