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

后端 未结 3 1514
梦如初夏
梦如初夏 2021-02-12 11:15

In my urls.py I have:

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


        
3条回答
  •  孤独总比滥情好
    2021-02-12 11:42

    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).

提交回复
热议问题