skip to navigation
skip to content

Not Logged In

django-shop-categories 1.0

A extendable category app using django-mptt for django-shop

A extendable category app using django-mptt for django-shop.


For the current stable version:

pip install django-shop-categories

For the development version:

pip install -e git+git://

Running tests:

git clone git://
cd django-shop-categories
virtualenv test_env
source ./test_env/bin/activate
pip install -r requirements.txt


Add shop_categories to settings.INSTALLED_APPS.

Set SHOP_PRODUCT_MODEL to shop_categories.models.defaults.product.default.CategoryProduct.

In your add this before your shop patterns:

urlpatterns += patterns('',
    url(r'^catalog/', include('shop_categories.urls')),

Then run: syncdb

Extending the Category model

In your own app make a models dir with and a dir, like so:


Note: Do not import the model from in, the model should NOT be in a “real” models module as this will cause the overridden Category model to be defined twice.


from django.db import models
from shop_categories.models.defaults.category.base import ProductCategoryBase

class Category(ProductCategoryBase):

    image = models.ImageField(upload_to='categoryimages/', null=True, blank=True)

    class Meta:
        abstract = False
        app_label = 'app'

Set SHOP_CATEGORIES_CATEGORY_MODEL to app.models.category.Category

Register your custom category model in

from shop_categories.models import Category
from shop_categories.admin import ProductCategoryAdmin, ProductCategoryAdmin)

Then, assuming your Product model is not already synced, run: syncdb

Extending the Product model

When extending Product models in your shop make sure they subclass from shop_categories.models.defaults.product.base.CategoryProductBase to add the Category Foreignkey and M2M fields.

Example implementation

An example of a django-shop with django-shop-categories can be found here:

File Type Py Version Uploaded on Size (md5) Source 2013-08-21 17KB
  • Downloads (All Versions):
  • 5 downloads in the last day
  • 88 downloads in the last week
  • 403 downloads in the last month