Skip to main content

A small shop for Django Framework

Project description

Django Plugshop
===============

A set of useless abstract models

Installation
============

* Add the `plugshop` directory to your Python path.

* Add `plugshop` to your `INSTALLED_APPS`

* Add the following middleware to your project's settings.py file:

`plugshop.middleware.CartMiddleware`

* Add the request context processor:

TEMPLATE_CONTEXT_PROCESSORS = (
# ...
'django.core.context_processors.request',
# ...
)

* Add URL-patterns:

urlpatterns = patterns('',
url(r'^shop/', include('plugshop.urls')),
)

* Override default models. Example:

PLUGSHOP_MODELS = {
'PRODUCT': 'testshop.myshop.models.Product',
'CATEGORY': 'testshop.myshop.models.Category',
}

* Run `python manage.py syncdb`


Configuration
=============

Models:

PLUGSHOP_MODELS = {
'PRODUCT': 'plugshop.models.product.Product',
'CATEGORY': 'plugshop.models.category.Category',
'ORDER': 'plugshop.models.order.Order',
'ORDER_PRODUCTS': 'plugshop.models.order_products.OrderProducts',
}

Config:


PLUGSHOP_CONFIG = {
'REQUEST_NAMESPACE': 'cart',
'SESSION_NAMESPACE': 'cart',
}

Other options:

PLUGSHOP_OPTIONS = {
# Possible values of the status of the order. Default values:
'STATUS_CHOICES': (
(1, _('Created')),
(2, _('Confirmed')),
(3, _('Denied')),
(4, _('Delivered')),
),
}

Cart
====

#views.py
def my_view(request):
cart = request.cart

Or

#settings.py
PLUGSHOP_CONFIG = {
...
'REQUEST_NAMESPACE': 'my_cart_namespace',
...
}

#views.py
def my_view(request):
cart = request.my_cart_namespace

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_plugshop-0.2.4.3-py2.7.egg (46.8 kB) Copy SHA256 hash SHA256 Egg 2.7 Jun 28, 2012
django-plugshop-0.2.4.3.tar.gz (16.6 kB) Copy SHA256 hash SHA256 Source None Jun 28, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page