Skip to content

Wagtail integration for Oscar Commerce (or Oscar Commerce integration for Wagtail?)

License

Notifications You must be signed in to change notification settings

CosmicBerlin/django-oscar-wagtail

 
 

Repository files navigation

Django Oscar Wagtail

https://travis-ci.org/LabD/django-oscar-wagtail.svg?branch=travis

This project integrates the Wagtail CMS with Django Oscar for eCommerce. It adds the following features:

  • each Oscar category page can now be managed by the Wagtail CMS
  • it is possible to add product lists to wagtail pages

Installation

Presuming you have installed Django-Oscar and Wagtail into your Django project.

First install django-oscar-wagtail via PIP:

pip install django-oscar-wagtail

And add oscar_wagtail to your settings as follows:

INSTALLED_APPS = [
    # ... your other apps
    'oscar_wagtail',
]

Add the URLs to urls.py:

import oscar_wagtail.urls

urlpatterns += [
    url(r'^api/oscar_wagtail/', include(oscar_wagtail.urls, namespace='oscar_wagtail')),
]

Fork the catalogue app as described in the oscar documentation. Then instead of using the AbstractCategory from Oscar use the one from this project as follows:

from oscar_wagtail.abstract_models import AbstractCategory


class Category(AbstractCategory):
    pass

from oscar.apps.catalogue.models import *

If you want to have a CMS button in the Oscar dashboard, add the following to your settings:

OSCAR_DASHBOARD_NAVIGATION.insert(1, {
    'label': 'CMS',
    'icon': 'icon-th-list',
    'url_name': 'wagtailadmin_home',
    'access_fn': lambda user, *args: user.has_perm('wagtailadmin.access_admin')
})

About

Wagtail integration for Oscar Commerce (or Oscar Commerce integration for Wagtail?)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 88.8%
  • JavaScript 5.3%
  • HTML 4.9%
  • Makefile 1.0%