ValueError: Field 'id' expected a number but got 'Processing'

前端 未结 8 1657
南方客
南方客 2021-01-27 23:55

I\'m going to deploy my django application on DigitalOcean. Everything gone well, except following error, and my question is: where can I find source of this error, actually in

8条回答
  •  梦毁少年i
    2021-01-28 00:14

    I had the same problem with simple CBV like TemplateView or ListView which does not require mandatory parameter. I'm pretty sure the issue comes from the url interpretation. For a simple ListView like

    class ProfileList(generic.ListView):
        model = get_user_model()
    

    The url

    path('profile_list/dummy', ProfileList.as_view(), name='profile_lv'),
    

    works, whereas the one below, doesn't, the error: Field 'id' expected a number but got 'profile_lv' is thrown. Where profile_lv is the name of the url...

    path('profile_list', ProfileList.as_view(), name='profile_lv'),
    

    The addition of anything with a slash(/) after the path works?!...

提交回复
热议问题