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
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
pysqlite python package is also required although it doesn't support C
extensions by default. To work-around this, there are two options:
Download the package, edit
setup.cfgto enable C extensions and install:
$ pip install pysqlite --no-install $ vim $VIRTUALENV/build/pysqlite/setup.cfg $ pip install pysqlite
Use a custom branch:
$ pip install git+git://github.com/tinio/pysqlite.git@extension-enabled#egg=pysqlite
First, ensure you are using a spatial database and have django-oscar installed.
pip install django-oscar-stores
INSTALLED_APPS. Now update your root
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
3577). This is used for distance calculations. See http://spatialreference.org for more details.
There is sandbox site within the repo which is a sample Oscar project that uses the stores extension. Set this up with:
then fetch the GeoIP files with:
This loads a fixture which provides a superuser to test the dashboard with:
email: firstname.lastname@example.org username: superuser password: testing
Run tests with:
django-oscar-stores is released under the permissive New BSD license.