django-countries: Person() takes exactly 1 argument (0 given)

后端 未结 2 1697
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 15:34

I am trying to use the django-countries application with Django for the first time but I am getting this error which has me confused.

TypeError at /survey/

Per         


        
2条回答
  •  孤街浪徒
    2021-01-28 16:16

    Your model and your view has the same name so you have a namespace conflict. Change the name of the view and it will be fine.

    The error says you need to pass an argument because you have redefined Person to be a function with 1 argument (request). Something like this should work (adapt your urls.py):

    def create_survey(request): 
         # ...
    

提交回复
热议问题