Django RedirectView and reverse() doesn't work together?

前端 未结 4 646
生来不讨喜
生来不讨喜 2021-01-11 12:49

I\'m having this weird problem.

When I did this:

from django.core.urlresolvers import reverse
reverse(\'account-reco-about-you\')
# returns \'/accoun         


        
4条回答
  •  孤城傲影
    2021-01-11 13:13

    @wtower pattern_name will be ok, but you may need to add namespace as below.

    RedirectView.as_view(pattern_name='polls:index')
    

提交回复
热议问题