Django-trolley is a lightweight cart system designed to work with a custom product catalogue app. One or more product catalogues can send products to the included cart via api.py; cart then takes care of gathering address details etc and payment.
Currently this is a work in progress.
Thanks to http://code.google.com/p/django-cart/ for inspiration.
- Django 1.2+ (may work on older versions too, not tested)
- simplejson
- One or more custom "product" apps - see below
-
Run
./setup.py install
to install the cart. Alternately, you can symlink or move thecart
directory onto your path. -
Add
'cart'
to INSTALLED_APPS -
Add
'cart.urls'
to your root url conf, i.e.(r'^cart/', include('cart.urls')),
-
Create templates for the cart model - you can start by copying the ones in
demo/templates/cart
-
Define the
CART_PAYMENT_BACKEND
setting -'cart.payment.manual'
is simplest. -
Create a
product
model to use with your cart - typically within ashop
app, but it can be anywhere. It must implementcart.models.CartProductInterface
. Alternately, copy the sampleshop
app into your project and customise. -
Create shop templates - samples are provided in
demo/templates/shop
django-trolley's payment system is designed to be usable by itself for non-shop payments (donations, generic website payments etc). An example app is provided (payment
) - to install, follow installation steps 1-4 above, and also do the following:
-
Symlink or move the
payment
directory onto your path. -
Add
'payment'
to INSTALLED_APPS -
Add
'payment.urls'
to your root url conf, i.e.(r'^payment/', include('payment.urls')),
-
Create a payment form template at
payment/index.html
— see thedemo/templates/payment/index.html
for an example.
An example shop app is provided - this can be used directly, or as a starting point for a custom shop app. Generally you'll want to write your own shop app since this one is very simple.
Various other settings are available for customisation - these are located and documented in the file cart/settings.py
, but can be overridden in your project's settings.py
with the CART prefix. Eg
CART_ORDER_DETAIL_MODEL = 'shop.OrderDetail'
A demo project is provided to demonstrate the example shop and payment app working in conjunction with the cart. To run the demo:
>> cd path-to-django-trolley/demo
>> python manage.py syncdb
>> python manage.py runserver