Skip to main content

An extension for Oscar to include store locations

Project description

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

Screenshots

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

Dependencies

GeoDjango is used so a spatial database is required. We recommend PostGIS. Django’s docs include some installation instructions.

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 $VIRTUALENV/build/pysqlite/setup.cfg
    $ pip install pysqlite
  2. 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 to INSTALLED_APPS. Now update your root urls.py:

from oscar.app import shop
from stores.app import application as stores_app
from stores.dashboard.app import application as dashboard_app

urlpatterns = patterns('',
    # basic configuration for Oscar
    url(r'', include(shop.urls)),

    # adds URLs for the dashboard store manager
    url(r'^dashboard/stores/', include(dashboard_app.urls)),

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

You also need to download the GeoIP data files and set GEOIP_PATH to point to the appropriate directory.

Settings

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

  • STORES_GEODETIC_SRID (default: 4326).

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

then fetch the GeoIP files with:

make geoip

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

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

Run tests with:

./runtests.py

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-0.3.1.tar.gz (22.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-oscar-stores-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8a42ac5b9895233994eaff061d4839f7f485de3f3b00e777fb3662e4b6fc1135
MD5 feb304d67431ac2c6c7d3f91f42afcea
BLAKE2b-256 d59e58c67d3776e569af8f35e0ad6d0d72e58692d034551e861a37f46c91136e

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