Slug Url Regex in Django

前端 未结 1 894
花落未央
花落未央 2021-02-09 10:27

After reading a lot about proper use of a slug to create a detail view from a list of objects. However, I am still having problems getting it to work for me. I am displaying a l

1条回答
  •  难免孤独
    2021-02-09 10:44

    You're not passing any arguments to build the detail URL. You probably want to do this:

    {% url "detail" thing.slug %}
    

    Which will create a detail URL with the given slug filled in.

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