Skip to main content

A small shop for Django Framework

Project description

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

A set of useless abstract models

Requirements
============

1. [django](https://github.com/django/django/) >= 1.4, <=1.5
2. [django-mptt](https://github.com/django-mptt/django-mptt/)

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': 'myshop.Product',
'CATEGORY': 'myshop.Category',
'ORDER': 'myshop.Order',
}

* Run `python manage.py syncdb`

* Profit!

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

Models:

PLUGSHOP_MODELS = {
'PRODUCT': 'plugshop.Product',
'CATEGORY': 'plugshop.Category',
'ORDER': 'plugshop.Order',
'ORDER_PRODUCTS': 'plugshop.OrderProducts',
}

Forms:

PLUGSHOP_FORMS = {
'ORDER': 'plugshop.forms.OrderForm',
}

Config:

PLUGSHOP_CONFIG = {
'REQUEST_NAMESPACE': 'cart',
'SESSION_NAMESPACE': 'cart',
'URL_PREFIX': 'shop/',
}

Other options:

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

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.

Source Distribution

django-plugshop-0.4.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_plugshop-0.4.1-py2.7.egg (45.6 kB view details)

Uploaded Egg

File details

Details for the file django-plugshop-0.4.1.tar.gz.

File metadata

File hashes

Hashes for django-plugshop-0.4.1.tar.gz
Algorithm Hash digest
SHA256 4d7a09e026877cbb8df0b702e027d8327da60025e405dcbaa9e0a7147715a72c
MD5 dc583ed5c388aa0a7a6e5b8820f26e98
BLAKE2b-256 67dca292c33cdb3f825f5bf922844be28e29f6172a5bb1a048774c0f19ff8343

See more details on using hashes here.

File details

Details for the file django_plugshop-0.4.1-py2.7.egg.

File metadata

File hashes

Hashes for django_plugshop-0.4.1-py2.7.egg
Algorithm Hash digest
SHA256 8120f35e5d40eba8544864a028c9d4c6351b3bca5fc451b8a4812bb2a3438644
MD5 2d26b4654428654b5f709f6587c36dcc
BLAKE2b-256 ad2d1f15aa711914022b4d061bb2f59732fbf347f3156d22931ea1b398194d12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page