Django Oscar Stores Save

Physical store integration for Django Oscar

Project README

============ Oscar stores

.. image::

.. image:: :alt: Coverage :target:

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

.. _django-oscar:

  • 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.


Customer-facing pages:

.. image:: :target:

.. image:: :target:

Dashboard pages:

.. image:: :target:

.. image:: :target:


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.

.. _GeoDjango: .. _installation instructions:

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

.. code:: bash

$ 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:

.. code:: bash

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

.. code:: bash

$ pip install git+git://

.. _pysqlite:


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

Install package:

.. code:: bash

$ pip install django-oscar-stores

Then add stores and stores.dashboard to INSTALLED_APPS.

Now update your root

.. code:: python

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'),


  • 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 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:

.. code:: python

from django.contrib.gis.measure import D
# Maximal distance of 150 miles
# Maximal distance of 150 kilometers


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

.. code:: bash

$ make sandbox

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

email: [email protected]
username: superuser
password: testing

Run tests with:

.. code:: bash

$ pytest


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

.. _New BSD license:

Open Source Agenda is not affiliated with "Django Oscar Stores" Project. README Source: django-oscar/django-oscar-stores
Open Issues
Last Commit
1 year ago

Open Source Agenda Badge

Open Source Agenda Rating