NoReverseMatch with {% url … %} and keyword args

前端 未结 2 664
春和景丽
春和景丽 2021-01-20 01:53

I\'m having a problem with this error:

Caught NoReverseMatch while rendering: Reverse for \'\'pennies.views.seed_preview\'\'
with arguments \'()\' and
keywor         


        
相关标签:
2条回答
  • 2021-01-20 02:48

    you are using the wrong keys, it should be

    {% url 'pennies.views.seed_preview' shareable_id=seed.id salt=seed.salt %}
    
    0 讨论(0)
  • 2021-01-20 02:49

    You need to load the future url template tag in every template where you use it. Loading a template tag library does not make it available to parent or child templates.

    For more info see the Django docs on Custom libraries and template inheritance

    0 讨论(0)
提交回复
热议问题