Django - How to pass several arguments to the url template tag

后端 未结 3 693
陌清茗
陌清茗 2021-02-12 11:36

In my urls.py I have:

(r\'^(?P\\d{4})/(?P\\d{2})/(?P\\d{2})/section/(?P[-\\w]+)/$\', 
    \'paper.views.issue_sec         


        
3条回答
  •  梦毁少年i
    2021-02-12 11:41

    Your month expression is (?P\d{2}), but you're sending it the argument 1. The 1 doesn't match \d{2}, so the url resolver isn't finding your view.

    Try changing the month expression to \d{1,2} (or something to that effect).

提交回复
热议问题