Browse files

Remove the demo site

The demo site was not kept up to date with the recent changes in Oscar
due to time contraints. It should be moved to a separate demo repository
in the future.
  • Loading branch information...
1 parent bcbbd05 commit 51980c748463d14f82295b6ad349f8cfa47580f2 @mvantellingen mvantellingen committed Nov 16, 2015
Showing 330 changed files with 25 additions and 55,986 deletions.
@@ -74,9 +74,6 @@ before_script:
# Create testing databases for running migrations against
- mysql -e 'CREATE DATABASE oscar_travis;'
- psql -c 'CREATE DATABASE oscar_travis;' -U postgres
- # Create database for building demo site
- - psql -c 'CREATE DATABASE oscar_demo;' -U postgres
- - psql -c 'CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;' -U postgres -d oscar_demo
- make travis
@@ -1,5 +1,5 @@
# These targets are not files
-.PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages css clean preflight make_sandbox make_demo
+.PHONY: install sandbox docs coverage lint travis messages compiledmessages css clean preflight make_sandbox
pip install -e . -r requirements.txt
@@ -24,34 +24,6 @@ build_sandbox:
sandbox: install build_sandbox
- wget
- gunzip GeoLiteCity.dat.gz
- mv GeoLiteCity.dat sites/demo/geoip
- # Install additional requirements
- pip install -r requirements_demo.txt
- # Create database
- # Breaks on Travis because of
- if [ -z "$(TRAVIS)" ]; then sites/demo/ reset_db --router=default --noinput; fi
- sites/demo/ migrate
- # Import some core fixtures
- sites/demo/ oscar_populate_countries
- sites/demo/ loaddata sites/_fixtures/pages.json
- # Create catalogue (create product classes from fixture than import CSV files)
- sites/demo/ loaddata sites/_fixtures/auth.json sites/demo/fixtures/offers.json
- sites/demo/ loaddata sites/demo/fixtures/product-classes.json sites/demo/fixtures/product-attributes.json sites/demo/fixtures/shipping-event-types.json
- sites/demo/ create_demo_products --class=Books sites/demo/fixtures/books.csv
- sites/demo/ create_demo_products --class=Downloads sites/demo/fixtures/downloads.csv
- sites/demo/ create_demo_products --class=Clothing sites/demo/fixtures/clothing.csv
- sites/demo/ oscar_import_catalogue_images sites/demo/fixtures/images.tar.gz
- # Update search index
- sites/demo/ clear_index --noinput
- sites/demo/ update_index catalogue
-demo: install build_demo
cd docs && make html
@@ -66,10 +38,10 @@ testmigrations:
pip install -r requirements_migrations.txt
cd sites/sandbox && ./
-# This target is run on We lint, test and build the sandbox/demo
-# sites as well as testing migrations apply correctly. We don't call 'install'
+# This target is run on We lint, test and build the sandbox
+# site as well as testing migrations apply correctly. We don't call 'install'
# first as that is run as a separate part of the Travis build process.
-travis: coverage lint build_sandbox build_demo testmigrations
+travis: coverage lint build_sandbox testmigrations
# Create the .po files used for i18n
@@ -25,7 +25,6 @@ Contents:
Further reading:
* `Official homepage`_
-* `Demo site`_ (a reference build of an Oscar project)
* `Sandbox site`_ (an hourly build of the unstable master branch - it's
experimental but feel free to explore and get a feel for the base Oscar
@@ -64,7 +63,6 @@ Docs status:
.. _`Official homepage`:
.. _`Sandbox site`:
-.. _`Demo site`:
.. _`Documentation`:
.. _``:
.. _`Continuous integration homepage`:!/django-oscar/django-oscar
@@ -125,23 +123,6 @@ make changes? Check out the `contributing guidelines`_.
.. _`in 5 commands`:
.. _`contributing guidelines`:
-Oscar also ships with a demo site, which is a reference build of an Oscar
-project. It integrates with Oscar's stores_, PayPal_ and Datacash_ extensions.
-.. image::
- :target:
-.. image::
- :target:
-The demo site is also available to browse at
-.. _stores:
-.. _PayPal:
@@ -26,7 +26,7 @@ Next, replace the example configuration with Oscar's.
$ cd solr-4.7.2/example/solr/collection1
$ mv conf conf.original
- $ ln -s <your_oscar_checkout>/sites/<sandbox|demo>/deploy/solr conf
+ $ ln -s <your_oscar_checkout>/sites/sandbox/deploy/solr conf
You should then be able to start Solr by running:
@@ -4,9 +4,9 @@ Importing a catalogue
.. warning::
- Handling imports works in Oscar, but the code quality of the importers is
- low as they are only used to populate the sandbox and demo site, and not
- meant for general usage. So proceed at your own risk!
+ Handling imports works in Oscar, but the code quality of the importer is
+ low as it is only used to populate the sandbox site, and not meant for
+ general usage. So proceed at your own risk!
Importing a catalogue is pretty straightforward, and can be done in two easy
@@ -22,31 +22,23 @@ steps:
-Two examples of that are ``CatalogueImporter`` and ``DemoSiteImporter``, used
-to import catalogues for the sandbox and demo-site, respectively. Both classes
-are available under ``oscar.apps.partner.importers``.
+An example of that is the ``CatalogueImporter`` used to import catalogues for
+the sandbox site. The class is available under
-Let's take a closer look at ``DemoSiteImporter``::
+Let's take a closer look at ``CatalogueImporter``::
- class DemoSiteImporter(object):
+ class CatalogueImporter(object):
def __init__(self, logger):
self.logger = logger
- def handle(self, product_class_name, filepath):
+ def _import(self, file_path=None):
- def create_product(self, product_class, attribute_codes, row): # noqa
+ def _import_row(self, row_number, row, stats):
The two steps procedure we talked about are obvious in this example, and are
-implemented in ``handle`` and ``create_product`` functions, respectively.
-Start by initializing the class with a logger, and call ``handle`` with
-``product_class_name`` and ``filepath`` arguments. There's absolutely no need
-to hard-code ``product_class_name`` and make product-class unified for all
-products like this example does, you can make it part of the CSV file content.
-``handle`` then calls ``create_product`` once for every line, and the latter
-uses Django ORM to create a couple of objects to represent the product and its
+implemented in ``_import`` and ``_import_row`` functions, respectively.
@@ -2,10 +2,8 @@
Sample Oscar projects
-Oscar ships with two sample projects: a 'sandbox' site, which is a vanilla
-install of Oscar using the default templates and styles and a fully featured
-'demo' site which demonstrates how Oscar can be re-skinned and customised to
-model a domain.
+Oscar ships with one sample project: a 'sandbox' site, which is a vanilla
+install of Oscar using the default templates and styles.
The sandbox site
@@ -86,72 +84,3 @@ at: http://localhost:8000. A sample superuser is installed with credentials::
username: superuser
password: testing
-.. _us_site:
-The demo site
-The demo site is *the* reference Oscar project as it illustrates how Oscar can
-be redesigned and customised to build an realistic e-commerce store. The demo
-site is a sailing store selling a range of different product types.
-The customisations on top of core Oscar include:
-* A new skin
-* A variety of product types including books, clothing and downloads
-* Payment with PayPal Express using django-oscar-paypal_.
-* Payment with bankcards using Datacash using django-oscar-datacash_.
-.. _django-oscar-paypal:
-.. _django-oscar-datacash:
-.. note::
- Both the sandbox and demo site have the Django admin interface wired up.
- This is done as a convenience for developers to browse the model instances.
- Having said that, the Django admin interface is *unsupported* and will fail
- or be of little use for some models. At the time of writing, editing
- products in the admin is clunky and slow, and editing categories is
- not supported at all.
-Browse the external demo site
-An instance of the demo site is built periodically (but not automatically) and
-available at It is typically updated when new
-versions of Oscar are released.
-Run the demo site locally
-Assuming you've already set-up the sandbox site, there are two further services
-required to run the demo site:
-* A spatially aware database such as PostGIS. The demo site uses
- django-oscar-stores_ which requires a spatial capabilities for store searching.
-* A search backend that supports faceting such as Solr. You should use the
- sample schema file from ``sites/demo/deploy/solr/schema.xml``.
-Once you have set up these services, create a local settings file from a template
-to house your credentials:
-.. code-block:: bash
- (oscar) $ cp sites/demo/settings_local{.sample,}.py
- (oscar) $ vim sites/demo/ # Add DB creds
-Now build the demo site:
-.. code-block:: bash
- (oscar) $ make demo
- (oscar) $ sites/demo/ runserver
-The demo (initialised with a sample set of products) will be available
-at: http://localhost:8000.
-.. _django-oscar-stores:
@@ -60,6 +60,10 @@ Backwards incompatible changes in Oscar 1.2
removed, it's not needed any more. Just use ``styles`` instead if you
happened to use it.
+- The US and Demo sites were both removed from the repository as they
+ were not up-to-date anymore. These might return in the future as
+ separate repositories.
@@ -4,5 +4,4 @@ gulp.task('watch', function() {
var watch = require('gulp-watch');'src/oscar/static/oscar/less/**/*.less', ['less']);
-'sites/demo/static/demo/less/**/*.less', ['demo:less']);
@@ -1,12 +0,0 @@
-# Oscar extensions
-# We need PostGIS as the stores extension uses GeoDjango.
-# To use Solr, we need pysolr
@@ -18,14 +18,3 @@ It does have a few customisations:
which should automatically allow the profile fields to be edited.
It is deployed hourly to:
-This is intended to show off some of Oscar's features, such as:
-* Customising core models
-* Overriding templates and CSS: changing the site appearance
-* Integrating with some of Oscar's extensions
-Most of this is still a work-in-progress.
No changes.
No changes.
@@ -1,11 +0,0 @@
-from import Shop
-from import application as checkout_app
-class Application(Shop):
- # Use local checkout app so we can mess with the view classes
- checkout_app = checkout_app
-application = Application()
No changes.
@@ -1,11 +0,0 @@
-from oscar.apps.checkout import app
-from apps.checkout import views
-class CheckoutApplication(app.CheckoutApplication):
- # Replace the payment details view with our own
- payment_details_view = views.PaymentDetailsView
-application = CheckoutApplication()
@@ -1,58 +0,0 @@
-from django import forms
-from oscar.apps.payment import forms as payment_forms
-from oscar.apps.order.models import BillingAddress
-class BillingAddressForm(payment_forms.BillingAddressForm):
- """
- Extended version of the core billing address form that adds a field so
- customers can choose to re-use their shipping address.
- """
- (SAME_AS_SHIPPING, 'Use shipping address'),
- (NEW_ADDRESS, 'Enter a new address'),
- )
- same_as_shipping = forms.ChoiceField(
- widget=forms.RadioSelect, choices=CHOICES, initial=SAME_AS_SHIPPING)
- class Meta(payment_forms.BillingAddressForm):
- model = BillingAddress
- exclude = ('search_text', 'first_name', 'last_name')
- def __init__(self, shipping_address, data=None, *args, **kwargs):
- # Store a reference to the shipping address
- self.shipping_address = shipping_address
- super(BillingAddressForm, self).__init__(data, *args, **kwargs)
- # If no shipping address (eg a download), then force the
- # 'same_as_shipping' field to have a certain value.
- if shipping_address is None:
- self.fields['same_as_shipping'].choices = (
- (self.NEW_ADDRESS, 'Enter a new address'),)
- self.fields['same_as_shipping'].initial = self.NEW_ADDRESS
- # If using same address as shipping, we don't need require any of the
- # required billing address fields.
- if data and data.get('same_as_shipping', None) == self.SAME_AS_SHIPPING:
- for field in self.fields:
- if field != 'same_as_shipping':
- self.fields[field].required = False
- def _post_clean(self):
- # Don't run model validation if using shipping address
- if self.cleaned_data.get('same_as_shipping') == self.SAME_AS_SHIPPING:
- return
- super(BillingAddressForm, self)._post_clean()
- def save(self, commit=True):
- if self.cleaned_data.get('same_as_shipping') == self.SAME_AS_SHIPPING:
- # Convert shipping address into billing address
- billing_addr = BillingAddress()
- self.shipping_address.populate_alternative_model(billing_addr)
- if commit:
- return billing_addr
- return super(BillingAddressForm, self).save(commit)
Oops, something went wrong.

0 comments on commit 51980c7

Please sign in to comment.