Permalink
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.
View
@@ -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
script:
- make travis
View
@@ -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
install:
pip install -e . -r requirements.txt
@@ -24,34 +24,6 @@ build_sandbox:
sandbox: install build_sandbox
-geoip:
- wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
- gunzip GeoLiteCity.dat.gz
- mv GeoLiteCity.dat sites/demo/geoip
-
-build_demo:
- # Install additional requirements
- pip install -r requirements_demo.txt
- # Create database
- # Breaks on Travis because of https://github.com/django-extensions/django-extensions/issues/489
- if [ -z "$(TRAVIS)" ]; then sites/demo/manage.py reset_db --router=default --noinput; fi
- sites/demo/manage.py migrate
- # Import some core fixtures
- sites/demo/manage.py oscar_populate_countries
- sites/demo/manage.py loaddata sites/_fixtures/pages.json
- # Create catalogue (create product classes from fixture than import CSV files)
- sites/demo/manage.py loaddata sites/_fixtures/auth.json sites/demo/fixtures/offers.json
- sites/demo/manage.py loaddata sites/demo/fixtures/product-classes.json sites/demo/fixtures/product-attributes.json sites/demo/fixtures/shipping-event-types.json
- sites/demo/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
- sites/demo/manage.py create_demo_products --class=Downloads sites/demo/fixtures/downloads.csv
- sites/demo/manage.py create_demo_products --class=Clothing sites/demo/fixtures/clothing.csv
- sites/demo/manage.py oscar_import_catalogue_images sites/demo/fixtures/images.tar.gz
- # Update search index
- sites/demo/manage.py clear_index --noinput
- sites/demo/manage.py update_index catalogue
-
-demo: install build_demo
-
docs:
cd docs && make html
@@ -66,10 +38,10 @@ testmigrations:
pip install -r requirements_migrations.txt
cd sites/sandbox && ./test_migrations.sh
-# This target is run on Travis.ci. 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 Travis.ci. 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
messages:
# Create the .po files used for i18n
View
@@ -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
install.)
@@ -64,7 +63,6 @@ Docs status:
.. _`Official homepage`: http://oscarcommerce.com
.. _`Sandbox site`: http://latest.oscarcommerce.com
-.. _`Demo site`: http://demo.oscarcommerce.com
.. _`Documentation`: http://django-oscar.readthedocs.org/en/latest/
.. _`readthedocs.org`: http://readthedocs.org
.. _`Continuous integration homepage`: http://travis-ci.org/#!/django-oscar/django-oscar
@@ -125,23 +123,6 @@ make changes? Check out the `contributing guidelines`_.
.. _`in 5 commands`: http://django-oscar.readthedocs.org/en/latest/internals/sandbox.html#running-the-sandbox-locally
.. _`contributing guidelines`: http://django-oscar.readthedocs.org/en/latest/internals/contributing/index.html
-Demo
-~~~~
-
-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:: https://github.com/django-oscar/django-oscar/raw/master/docs/images/screenshots/demo.home.thumb.png
- :target: https://github.com/django-oscar/django-oscar/raw/master/docs/images/screenshots/demo.home.png
-
-.. image:: https://github.com/django-oscar/django-oscar/raw/master/docs/images/screenshots/demo.browse.thumb.png
- :target: https://github.com/django-oscar/django-oscar/raw/master/docs/images/screenshots/demo.browse.png
-
-The demo site is also available to browse at
-http://demo.oscarcommerce.com
-
-.. _stores: https://github.com/django-oscar/django-oscar-stores
-.. _PayPal: https://github.com/django-oscar/django-oscar-paypal
Extensions
----------
@@ -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
steps:
@@ -22,31 +22,23 @@ steps:
Example
-------
-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
+``oscar.apps.partner.importers``.
-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
@atomic
- 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
-properties.
+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
email: superuser@example.com
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: https://github.com/django-oscar/django-oscar-paypal
-.. _django-oscar-datacash: https://github.com/django-oscar/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 http://demo.oscarcommerce.com. 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/settings_local.py # Add DB creds
-
-Now build the demo site:
-
-.. code-block:: bash
-
- (oscar) $ make demo
- (oscar) $ sites/demo/manage.py runserver
-
-The demo (initialised with a sample set of products) will be available
-at: http://localhost:8000.
-
-.. _django-oscar-stores: https://github.com/django-oscar/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.
+
Misc
~~~~
@@ -4,5 +4,4 @@ gulp.task('watch', function() {
var watch = require('gulp-watch');
gulp.watch('src/oscar/static/oscar/less/**/*.less', ['less']);
- gulp.watch('sites/demo/static/demo/less/**/*.less', ['demo:less']);
});
View
@@ -1,12 +0,0 @@
-# Oscar extensions
-https://github.com/django-oscar/django-oscar-stores/archive/630aa146066cd327085fe9206dc50f6e520cc023.zip#egg=django-oscar-stores==1.0-dev
-django-oscar-paypal==0.9.1
-django-oscar-datacash==0.8.3
-
-# We need PostGIS as the stores extension uses GeoDjango.
-psycopg2==2.5.1
-
-# To use Solr, we need pysolr
-pysolr==3.2
-
-raven==4.0.3
View
@@ -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: http://latest.oscarcommerce.com
-
-Demo
-----
-
-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 oscar.app import Shop
-
-from apps.checkout.app 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, NEW_ADDRESS = 'same', 'new'
- CHOICES = (
- (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:
- billing_addr.save()
- return billing_addr
- return super(BillingAddressForm, self).save(commit)
Oops, something went wrong.

0 comments on commit 51980c7

Please sign in to comment.