django-sitecats
https://github.com/idlesign/django-sitecats
Description
Django reusable application for content categorization.
Nay, — you say, — all that tags business lacks structuring.
This application is just about structuring your data: build categories hierarchy and link your site entities to those categories.
# Somewhere in views.py
from django.shortcuts import render, get_object_or_404
# Suppose Article model has sitecats.models.ModelWithCategory class mixed in.
from .models import Article
def article_details(self, request, article_id):
"""See, there is nothing special in this view, yet it'll render a page with categories for the article."""
return self.render(request, 'article.html', {'article': get_object_or_404(Article, pk=article_id)})
def article_edit(self, request, article_id):
"""Let's allow this view to render and handle categories editor."""
article = get_object_or_404(Article, pk=article_id)
# Now we enable category editor for an article, and allow users
# to add subcategories to `language`, and `os` categories
# (suppose we created them beforehand with Admin contrib),
# and link this article to them.
article.enable_category_lists_editor(
request,
editor_init_kwargs={'allow_new': True},
additional_parents_aliases=['language', 'os']
)
form = ... # Your usual Article edit handling code will be here.
return render(request, 'article.html', {'article': article, 'form': form})
Template coding basically boils down to sitecats_categories template tags usage:
<!-- The same html is just fine for demonstration purposes for both our views.
Do not forget to load `sitecats` template tags library. -->
{% extends "base.html" %}
{% load sitecats %}
{% block contents %}
<!-- Some additional functionality (e.g. categories cloud rendering,
editor enhancements) will require JS. -->
<script src="{{ STATIC_URL }}js/sitecats/sitecats.min.js"></script>
<h1>{{ article.title }}</h1>
<div id="article_categories">
{% sitecats_categories from article %} <!-- And that's it. -->
</div>
<!-- Form code goes somewhere here. -->
{% endblock %}
Read the docs, sitecats can do more.
Documentation
Metadata
Release files for django-sitecats 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_sitecats-1.2.3.tar.gz | 22.4 kB | Without provenance | Details for django_sitecats-1.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_sitecats-1.2.3-py3-none-any.whl | Python 3 | none | any | Details for django_sitecats-1.2.3-py3-none-any.whl |
Total release size: 55.3 kB
Release files / django_sitecats-1.2.3.tar.gz
| Download URL | django_sitecats-1.2.3.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9d04ff55e08338c008ccee6cc25cb9687e163e161aaf92fab6f977e45e0e834
|
|
BLAKE2b-256 checksum How to use checksums |
8b2e89665a5398fa4036e62394e1df1e21fe2d4a033b682524838fb72663fc6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / django_sitecats-1.2.3-py3-none-any.whl
| Download URL | django_sitecats-1.2.3-py3-none-any.whl |
|---|---|
| Size | 32.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e03f4232b6aa6659d250bca35769a38d477e5093b11df2b7a305dcf79462d52
|
|
BLAKE2b-256 checksum How to use checksums |
f950b6954d177993fd48c9006dc6617e91e6a8f2a70f1a69495536c6520b05c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for django-sitecats 1.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.