Reverse Django generic view, post_save_redirect; error 'included urlconf doesnt have any patterns'

后端 未结 4 1353
再見小時候
再見小時候 2021-02-06 17:01

I did see the other question titled \'how to use django reverse a generic view\' and \'django named urls, generic views\' however my question is a little different and I do not

4条回答
  •  一个人的身影
    2021-02-06 17:48

    You have a typo - no opening quote before post_save_redirect. Also, have you imported list_detail and create_update since you are referring to the modules directly, rather than as strings?

    Edited I suspect that the problem comes from having a call to reverse in the partners_add dictionary. I think this will lead to a circular dependency, since the urlconf now depends on attributes which have not yet been defined at the time the urlconf is imported.

    Try removing that call - perhaps hard-code the relevant url - and see if it works.

提交回复
热议问题