Skip to main content

Oscar stores

https://github.com/django-oscar/django-oscar-stores/workflows/Tests/badge.svg 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
    path('', include(apps.get_app_config('oscar').urls[0])),

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

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

    # adds internationalization URLs
    path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
]

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.

Release files for django-oscar-stores 3.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-oscar-stores 3.0.2
File Size Uploaded
django-oscar-stores-3.0.2.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-oscar-stores 3.0.2
File Interpreter ABI Platform
django_oscar_stores-3.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 61.3 kB

Release files / django-oscar-stores-3.0.2.tar.gz

Download URL django-oscar-stores-3.0.2.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0bf8baab32973e92942cd37bf445ad529aab0d54c07280818d53c9d267ea4f3a
BLAKE2b-256 checksum
How to use checksums
6d37e6b723e3c3b02f17a401d36ba9f5963221d40f30670b0596aeeebb7b4d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

Release files / django_oscar_stores-3.0.2-py3-none-any.whl

Download URL django_oscar_stores-3.0.2-py3-none-any.whl
Size 37.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60407f68c591eb072ea0225ae7c76001829c28fcbaf87f842b1a251ad75e284e
BLAKE2b-256 checksum
How to use checksums
2b91ce8e1f6808428a2b26bc06228083ab0733916bb6594751a16d66d90db221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

3.0.2 This release

2 release files

3.0.1

2 release files

3.0

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8

1 release file

0.7

1 release file

0.6.1

1 release file

0.6

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.1

1 release file

0.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

0.0.1a

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page