Tomkay
Tomkay

Reputation: 5160

How to integrate django shop with django cms?

I want to use Django Shop with the Django CMS.

It should be possible to add the Django Shop app to a page (for example: products). It also should use category pages for product listing (products/print/books/). It should display a detail template on a product page (products/print/books/hardcover).

I didn't find it easy to integrate Django Shop with Django CMS as advertised on the official Django website. Is it possible to overwrite/extend or add files to the Django Shop App? I don't want to hack the code of the app.

Upvotes: 1

Views: 2543

Answers (1)

Dmitry
Dmitry

Reputation: 11

Django-shop can be integrated with django-cms. There are two common cases in general: from scratch and add django-shop to an existing app based on django-cms. The first case is pretty simple: you can use django-shop cookiecutter template
https://github.com/awesto/cookiecutter-django-shop
and get already working integration. All you need is to customize this skeleton.

The second case is not so obvious. You need to install django-shop as a dependency: pip install django-shop. Then you will probably want to override at least Commodity model. You can do it according to the deferred model pattern: https://django-shop.readthedocs.io/en/latest/reference/deferred-models.html
In case of already existing app you can have the problems with the User model if it's overridden in the main app. To solve it, I'd recommend you this fork
https://github.com/Dimitrionian/django-shop
which uses overridden User model from the main app.

Upvotes: 1

Related Questions