Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom session cookie name #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ After installation is complete:

A basic usage of django-cart could be (example):

```python
# settings.py

CART_ID = 'CART_ID' # set the name of your session cookie for the cart
```

```python
# views.py
from cart.cart import Cart
Expand Down
6 changes: 5 additions & 1 deletion cart/cart.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import datetime
from django.db.models import Sum
from django.db.models import F
from django.conf import settings
from . import models

CART_ID = 'CART-ID'
if settings.CART_ID:
CART_ID = settings.CART_ID
else:
CART_ID = 'CART-ID'


class ItemAlreadyExists(Exception):
Expand Down