How do I construct a Django reverse/url using query args?

后端 未结 6 477
长发绾君心
长发绾君心 2020-12-13 04:25

I have URLs like http://example.com/depict?smiles=CO&width=200&height=200 (and with several other optional arguments)

My urls.py contains:

ur         


        
6条回答
  •  我在风中等你
    2020-12-13 05:03

    Neither of the original answers addresses the related issue resolving URLs in view code. For future searchers, if you are trying to do this, use kwargs, something like:

    reverse('myviewname', kwargs={'pk': value})
    

提交回复
热议问题