• Stars
    star
    455
  • Rank 92,810 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 14 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This app attempts to provide a generic category system that multiple apps could use. It uses MPTT for the tree storage and provides a custom admin for better visualization (copied and modified from feinCMS).

Django Categories

Jazzband codecov

Django Categories grew out of our need to provide a basic hierarchical taxonomy management system that multiple applications could use independently or in concert.

As a news site, our stories, photos, and other content get divided into "sections" and we wanted all the apps to use the same set of sections. As our needs grew, the Django Categories grew in the functionality it gave to category handling within web pages.

Features of the project

Currently incompatible with Python 3.10.

Multiple trees, or a single tree. You can treat all the records as a single tree, shared by all the applications. You can also treat each of the top level records as individual trees, for different apps or uses.

Easy handling of hierarchical data. We use Django MPTT to manage the data efficiently and provide the extra access functions.

Easy importation of data. Import a tree or trees of space- or tab-indented data with a Django management command.

Metadata for better SEO on web pages Include all the metadata you want for easy inclusion on web pages.

Link uncategorized objects to a category Attach any number of objects to a category, even if the objects themselves aren't categorized.

Hierarchical Admin Shows the data in typical tree form with disclosure triangles

Template Helpers Easy ways for displaying the tree data in templates:

  • Show one level of a tree. All root categories or just children of a specified category

  • Show multiple levels. Ancestors of category, category and all children of category or a category and its children

Changes

New in 1.8

  • Support for Django 3.1
  • Removed support for Python 2.7

New in 1.7

  • Support for Django 3

New in 1.6

  • Support for Django 2

New in 1.5

  • Support for Django 1.10

New in 1.4

  • Support for Python 2.7, 3.4 and 3.5
  • Support for Django 1.9
  • Dropped support for Django 1.7 and older

New in 1.3

  • Support for Django 1.6, 1.7 and 1.8
  • Dropped support for Django versions 1.5 and below

New in 1.2

  • Support for Django 1.5
  • Dropped support for Django 1.2
  • Dropped caching within the app
  • Removed the old settings compatibility layer. Must use new dictionary-based settings!

New in 1.1

  • Fixed a cosmetic bug in the Django 1.4 admin. Action checkboxes now only appear once.

  • Template tags are refactored to allow easy use of any model derived from CategoryBase.

  • Improved test suite.

  • Improved some of the documentation.

Upgrade path from 1.0.2 to 1.0.3

Due to some data corruption with 1.0.2 migrations, a partially new set of migrations has been written in 1.0.3; and this will cause issues for users on 1.0.2 version. There is also an issue with South version 0.7.4. South version 0.7.3 or 0.7.5 or greater works fine.

For a clean upgrade from 1.0.2 to 1.0.3 you have to delete previous version of 0010 migration (named 0010_changed_category_relation.py) and fakes the new 00010, 0011 and 0012.

Therefore after installing new version of django-categories, for each project to upgrade you should execute the following commans in order

python manage.py migrate categories 0010_add_field_categoryrelation_category --fake --delete-ghost-migrations
python manage.py migrate categories 0011_move_category_fks --fake
python manage.py migrate categories 0012_remove_story_field --fake
python manage.py migrate categories 0013_null_category_id

This way both the exact database layout and migration history is restored between the two installation paths (new installation from 1.0.3 and upgrade from 1.0.2 to 1.0.3).

Last migration is needed to set the correct null value for category_id field when upgrading from 1.0.2 while is a noop for 1.0.3.

New in 1.0

Abstract Base Class for generic hierarchical category models. When you want a multiple types of categories and don't want them all part of the same model, you can now easily create new models by subclassing CategoryBase. You can also add additional metadata as necessary.

Your model's can subclass CategoryBaseAdminForm and CategoryBaseAdmin to get the hierarchical management in the admin.

See the docs for more information.

Increased the default caching time on views. The default setting for CACHE_VIEW_LENGTH was 0, which means it would tell the browser to never cache the page. It is now 600, which is the default for CACHE_MIDDLEWARE_SECONDS

Updated for use with Django-MPTT 0.5. Just a few tweaks.

Initial compatibility with Django 1.4. More is coming, but at least it works.

Slug transliteration for non-ASCII characters. A new setting, SLUG_TRANSLITERATOR, allows you to specify a function for converting the non-ASCII characters to ASCII characters before the slugification. Works great with Unidecode.

Updated in 0.8.8

The editor app was placed inside the categories app, categories.editor, to avoid any name clashes.

Upgrading

A setting change is all that is needed:

INSTALLED_APPS = (
    'categories',
    'categories.editor',
)

New in 0.8

Added an active field. As an alternative to deleting categories, you can make them inactive.

Also added a manager method active() to query only the active categories and added Admin Actions to activate or deactivate an item.

Improved import. Previously the import saved items in the reverse order to the imported file. Now them import in order.

New in 0.7

Added South migrations. All the previous SQL scripts have been converted to South migrations.

Can add category fields via management command (and South). The new ability to setup category relationships in settings.py works fine if you are starting from scratch, but not if you want to add it after you have set up the database. Now there is a management command to make sure all the correct fields and tables are created.

Added an alternate_url field. This allows the specification of a URL that is not derived from the category hierarchy.

New JAVASCRIPT_URL setting. This allows some customization of the genericcollections.js file.

New get_latest_objects_by_category template tag. This will do pretty much what it says.

New in 0.6

Class-based views. Works great with Django 1.3 or django-cbv

New Settings infrastructure. To be more like the Django project, we are migrating from individual CATEGORIES_* settings to a dictionary named CATEGORIES_SETTINGS. Use of the previous settings will still work but will generate a DeprecationError.

The tree's initially expanded state is now configurable. EDITOR_TREE_INITIAL_STATE allows a collapsed or expanded value. The default is collapsed.

Optional Thumbnail field. Have a thumbnail for each category!

"Categorize" models in settings. Now you don't have to modify the model to add a Category relationship. Use the new settings to "wire" categories to different models.

More Repositories

1

django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
Python
7,858
star
2

pip-tools

A set of tools to keep your pinned Python dependencies fresh.
Python
7,398
star
3

tablib

Python Module for Tabular Datasets in XLS, CSV, JSON, YAML, &c.
Python
4,500
star
4

django-silk

Silky smooth profiling for Django
Python
4,210
star
5

djangorestframework-simplejwt

A JSON Web Token authentication plugin for the Django REST Framework.
Python
3,765
star
6

django-taggit

Simple tagging for django
Python
3,205
star
7

django-oauth-toolkit

OAuth2 goodies for the Djangonauts!
Python
3,021
star
8

django-redis

Full featured redis cache backend for Django.
Python
2,773
star
9

django-model-utils

Django model mixins and utilities.
Python
2,577
star
10

django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
Python
2,210
star
11

django-simple-history

Store model history and view/revert changes from admin site.
Python
2,083
star
12

django-widget-tweaks

Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.
Python
2,019
star
13

sorl-thumbnail

Thumbnails for Django
Python
1,717
star
14

django-constance

Dynamic Django settings.
Python
1,643
star
15

django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
Python
1,590
star
16

django-polymorphic

Improved Django model inheritance with automatic downcasting
Python
1,577
star
17

django-pipeline

Pipeline is an asset packaging library for Django.
Python
1,489
star
18

dj-database-url

Use Database URLs in your Django Application.
Python
1,439
star
19

django-axes

Keep track of failed login attempts in Django-powered sites.
Python
1,356
star
20

django-tinymce

TinyMCE integration for Django
JavaScript
1,231
star
21

prettytable

Display tabular data in a visually appealing ASCII table format
Python
1,223
star
22

django-admin2

Extendable, adaptable rewrite of django.contrib.admin
Python
1,182
star
23

django-analytical

Analytics services for Django projects
Python
1,174
star
24

django-smart-selects

chained and grouped selects for django forms
Python
1,094
star
25

django-waffle

A feature flipper for Django
Python
1,075
star
26

django-configurations

A helper for organizing Django project settings by relying on well established programming patterns.
Python
1,067
star
27

django-rest-knox

Authentication Module for django rest auth
Python
1,057
star
28

django-defender

A simple super fast django reusable app that blocks people from brute forcing login attempts
Python
997
star
29

django-auditlog

A Django app that keeps a log of changes made to an object.
Python
990
star
30

django-payments

Universal payment handling for Django.
Python
964
star
31

django-hosts

Dynamic and static host resolving for Django. Maps hostnames to URLconfs.
Python
942
star
32

django-nose

Django test runner using nose
Python
882
star
33

django-dbbackup

Management commands to help backup and restore your project database and media files
Python
879
star
34

geojson

Python bindings and utilities for GeoJSON
Python
876
star
35

django-floppyforms

Full control of form rendering in the templates.
Python
836
star
36

django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
Python
825
star
37

django-avatar

A Django app for handling user avatars.
Python
797
star
38

django-formtools

A set of high-level abstractions for Django forms
Python
735
star
39

django-user-sessions

Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions.
Python
586
star
40

django-admin-sortable

Generic drag-and-drop ordering for objects and tabular inlines in Django Admin
Python
557
star
41

django-invitations

Generic invitations app for Django
Python
530
star
42

django-sortedm2m

A transparent sorted ManyToMany field for django.
Python
508
star
43

django-recurrence

Utility for working with recurring dates in Django.
Python
460
star
44

django-robots

A Django app for managing robots.txt files following the robots exclusion protocol
Python
451
star
45

django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
Python
383
star
46

wagtailmenus

An app to help you manage and render menus in your Wagtail projects more effectively
Python
380
star
47

django-downloadview

Serve files with Django.
Python
357
star
48

jsonmodels

jsonmodels is library to make it easier for you to deal with structures that are converted to, or read from JSON.
Python
328
star
49

django-queued-storage

Provides a proxy for Django storage backends that allows you to upload files locally and eventually serve them remotely
Python
314
star
50

django-permission

[Not maintained] An enhanced permission system which support object permission in Django
Python
302
star
51

django-eav2

Django EAV 2 - EAV storage for modern Django
Python
297
star
52

django-revproxy

Reverse Proxy view that supports all HTTP methods, Diazo transformations and Single Sign-On.
Python
290
star
53

django-authority

A Django app that provides generic per-object-permissions for Django's auth app and helpers to create custom permission checks.
Python
286
star
54

django-simple-menu

Simple, yet powerful, code-based menus for Django applications
Python
258
star
55

django-dbtemplates

Django template loader for database stored templates with extensible cache backend
JavaScript
250
star
56

django-mongonaut

Built from scratch to replicate some of the Django admin functionality and add some more, to serve as an introspective interface for Django and Mongo.
Python
240
star
57

django-fsm-log

Automatic logging for Django FSM
Python
235
star
58

django-cookie-consent

Reusable application for managing various cookies and visitors consent for their use in Django project.
Python
210
star
59

django-celery-monitor

Celery Monitoring for Django
Python
191
star
60

django-ddp

Django/PostgreSQL implementation of the Meteor server.
Python
167
star
61

icalevents

Python module for iCal URL/file parsing and querying.
Python
153
star
62

docopt-ng

Humane command line arguments parser. Now with maintenance, typehints, and complete test coverage.
Python
149
star
63

django-voting

A generic voting application for Django
Python
93
star
64

django-ical

iCal feeds for Django based on Django's syndication feed framework.
Python
89
star
65

django-flatblocks

django-chunks + headerfield + variable chunknames + "inclusion tag" == django-flatblocks
Python
82
star
66

django-redshift-backend

Redshift database backend for Django
Python
80
star
67

pathlib2

Backport of pathlib aiming to support the full stdlib Python API.
Python
80
star
68

website

Code for the Jazzband website
Python
63
star
69

django-sorter

A helper app for sorting objects in Django templates.
Python
53
star
70

django-discover-jenkins

A streamlined fork of django-jenkins designed to work with the default test command and the discover runner
Python
49
star
71

contextlib2

contextlib2 is a backport of the standard library's contextlib module to earlier Python versions.
Python
37
star
72

django-fernet-encrypted-fields

Python
35
star
73

imaplib2

Fork of Piers Lauder's imaplib2 library for Python.
Python
31
star
74

help

Use this repo to get help from the roadies
27
star
75

.github

Community health and config files for Jazzband
7
star
76

django-postgres-utils

Django app providing additional lookups and functions for PostgreSQL
Python
7
star
77

admin

Some admin files for Jazzband
3
star
78

actions

Various GitHub actions for Jazzband projects
1
star