Skip to main content

An extension for Oscar to include stores

Project description

https://secure.travis-ci.org/django-oscar/django-oscar-stores.png Coverage

This is an extension for django-oscar that adds support for stores. It provides:

  • A store locator page using Google maps for geocoding. It also supports using the browser’s location to show the nearest stores.

  • Store detail pages including opening hours

  • Store groups

  • A dashboard for managing stores

It’s highly extensible and can be used as a foundation for building sophisticated stores functionality within Oscar sites.

Screenshots

Customer-facing pages:

https://github.com/django-oscar/django-oscar-stores/raw/master/docs/images/locator.thumb.png https://github.com/django-oscar/django-oscar-stores/raw/master/docs/images/detail.thumb.png

Dashboard pages:

https://github.com/django-oscar/django-oscar-stores/raw/master/docs/images/dashboard-list.thumb.png https://github.com/django-oscar/django-oscar-stores/raw/master/docs/images/dashboard-detail.thumb.png

Dependencies

GeoDjango is used so a spatial database is required. We recommend PostGIS. Django’s docs include some installation instructions although it is renowned for being tricky.

Spatialite is another option although it can be tricky to set up. On Ubuntu, you can do the following:

$ sudo apt-get install spatialite-bin libspatialite3 libgeos++-dev libgdal-dev libproj0

The pysqlite python package is also required although it doesn’t support C extensions by default. To work-around this, there are two options:

  1. Download the package, edit setup.cfg to enable C extensions and install:

$ pip install pysqlite --no-install
$ vim $VIRTUAL_ENV/build/pysqlite/setup.cfg
$ pip install pysqlite
  1. Use a custom branch:

$ pip install git+git://github.com/tinio/pysqlite.git@extension-enabled#egg=pysqlite

Installation

First, ensure you are using a spatial database and have django-oscar installed.

Install package:

$ pip install django-oscar-stores

Then add stores and stores.dashboard to INSTALLED_APPS.

Now update your root urls.py:

from django.views.i18n import JavaScriptCatalog

urls = [
    # basic configuration for Oscar
    url(r'^', include(apps.get_app_config('oscar').urls[0])),

    # adds URLs for the dashboard store manager
    url(r'^dashboard/stores/', apps.get_app_config('stores_dashboard').urls),

    # adds URLs for overview and detail pages
    url(r'^stores/', apps.get_app_config('stores').urls),

    # adds internationalization URLs
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalogue'),
]

Settings

  • GOOGLE_MAPS_API_KEY (default: not set). Maps API key for use with Maps and Geocode APIs. You must provide this key.

  • STORES_GEOGRAPHIC_SRID (default: 3577). This is used for distance calculations. See http://spatialreference.org for more details.

  • STORES_GEODETIC_SRID (default: 4326).

  • STORES_MAX_SEARCH_DISTANCE (default: None). This filters stores in queries by distance. Units can be set using distance object:

from django.contrib.gis.measure import D
# Maximal distance of 150 miles
STORES_MAX_SEARCH_DISTANCE = D(mi=150)
# Maximal distance of 150 kilometers
STORES_MAX_SEARCH_DISTANCE = D(km=150)

Contributing

There is sandbox site within the repo which is a sample Oscar project that uses the stores extension. Set this up with:

$ make sandbox

This loads a fixture which provides a superuser to test the dashboard with:

email: superuser@example.com
username: superuser
password: testing

Run tests with:

$ pytest

License

django-oscar-stores is released under the permissive New BSD license.

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-oscar-stores-2.1.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

django_oscar_stores-2.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file django-oscar-stores-2.1.tar.gz.

File metadata

  • Download URL: django-oscar-stores-2.1.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for django-oscar-stores-2.1.tar.gz
Algorithm Hash digest
SHA256 af5b8371ede96cdbf1bb17c890a080e7351fd24a00372824b3c784acfb7d29a3
MD5 f08a79aa4602a59fbe15306e54435249
BLAKE2b-256 2ba5ea32d178da66032b82b996f09b8fc883882246bdd0a5c3b516751dcf9992

See more details on using hashes here.

File details

Details for the file django_oscar_stores-2.1-py3-none-any.whl.

File metadata

  • Download URL: django_oscar_stores-2.1-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for django_oscar_stores-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 412b9c451f853851f263eb2a76f0f81e3bb50bb19123ee06f940f5ff2e8bc33f
MD5 c9307328c36d10636aa1eabf4d931526
BLAKE2b-256 4494a8a81716a9cabda4fb9f0d0e3508b6c7e3cd7e5d555954259ee46d13cdac

See more details on using hashes here.

Supported by

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