Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将 Django 用于一个项目。
我需要能够提取可用的可能类别。
{% for category in article.categories.all %} {{ category.name }} {% if not forloop.last %}, {% endif %} {% endfor %}
所以我可以在文章页面上使用它来查看它与哪个类别相关联。但是如何提取可用类别以显示为列表。