Django Carton - Shopping Cart and Wish List
+------+ /| /| +-+----+ | django-carton helps you build your shopping | | | | cart and which list functionality. | +----+-+ |/ |/ +------+
It’s simple: You decide how to implement the views, templates and payment processing.
It’s lightweight: The cart lives in the session.
It’s just a container: You define your product model the way you want.
Usage Example
View:
from django.http import HttpResponse
from carton.cart import Cart
from products.models import Product
def add(request):
cart = Cart(request.session)
product = Product.objects.get(id=request.GET.get('product_id'))
cart.add(product, price=product.price)
return HttpResponse("Added")
def show(request):
return render(request, 'shopping/show-cart.html')
We are assuming here that your products are defined in an application called products.
Template:
{% load carton_tags %}
{% get_cart as cart %}
{% for item in cart.items %}
{{ item.product.name }}
{{ item.quantity }}
{{ item.total_price }}
{% endfor %}
You can also use this convinent shortcut:
{% for product in cart.products %}
{{ product.name }}
{% endfor %}
Documentation
Read more: https://github.com/lazybird/django-carton/
Metadata
Release files for django-carton 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-carton-1.2.1.tar.gz | 8.0 kB | Without provenance | Details for django-carton-1.2.1.tar.gz |
Release files / django-carton-1.2.1.tar.gz
| Download URL | django-carton-1.2.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
247f4c427c6b651e9aa910020ba08606b9c46f5443b1c7e0c89ba75aba2bc6c1
|
|
BLAKE2b-256 checksum How to use checksums |
a8fa95579da565b081615d7665a11dc1f22606dab2e35d9542518bb22a75d3fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-carton 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.