You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sandbox.rst 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. =====================
  2. Sample Oscar projects
  3. =====================
  4. Oscar ships with two sample projects: a 'sandbox' site, which is a vanilla
  5. install of Oscar using the default templates and styles and a fully featured
  6. 'demo' site which demonstrates how Oscar can be re-skinned and customised to
  7. model a domain.
  8. The sandbox site
  9. ----------------
  10. The sandbox site is a minimal implementation of Oscar where everything is left
  11. in its default state. It is useful for exploring Oscar's functionality
  12. and developing new features.
  13. It only has one notable customisation on top of Oscar's core:
  14. * A profile class is specified which defines a few simple fields. This is to
  15. demonstrate the account section of Oscar, which introspects the profile class
  16. to build a combined User and Profile form.
  17. Note that some things are deliberately not implemented within core Oscar as they
  18. are domain-specific. For instance:
  19. * All tax is set to zero.
  20. * No shipping methods are specified. The default is free shipping which will
  21. be automatically selected during checkout (as it's the only option).
  22. * No payment is required to submit an order as part of the checkout process.
  23. The sandbox is, in effect, the blank canvas upon which you can build your site.
  24. Browse the external sandbox site
  25. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26. An instance of the sandbox site is built hourly from master branch and made
  27. available at http://latest.oscarcommerce.com
  28. .. warning::
  29. It is possible for users to access the dashboard and edit the site content.
  30. Hence, the data can get quite messy. It is periodically cleaned up.
  31. Run the sandbox locally
  32. ~~~~~~~~~~~~~~~~~~~~~~~
  33. It's pretty straightforward to get the sandbox site running locally so you can
  34. play around with Oscar.
  35. .. warning::
  36. While installing Oscar is straightforward, some of Oscar's dependencies
  37. don't support Windows and are tricky to be properly installed, and therefore
  38. you might encounter some errors that prevent a successful installation.
  39. Install Oscar and its dependencies within a virtualenv:
  40. .. code-block:: bash
  41. $ git clone https://github.com/django-oscar/django-oscar.git
  42. $ cd django-oscar
  43. $ mkvirtualenv oscar # needs virtualenvwrapper
  44. (oscar) $ make sandbox
  45. (oscar) $ sites/sandbox/manage.py runserver
  46. .. warning::
  47. Note, these instructions will install the head of Oscar's 'master' branch,
  48. not an official release. Occasionally the sandbox installation process
  49. breaks while support for a new version of Django is being added (often due
  50. dependency conflicts with 3rd party libraries). Please ask on the mailing
  51. list if you have problems.
  52. If you do not have ``mkvirtualenv``, then replace that line with:
  53. .. code-block:: bash
  54. $ virtualenv oscar
  55. $ source ./oscar/bin/activate
  56. (oscar) $
  57. The sandbox site (initialised with a sample set of products) will be available
  58. at: http://localhost:8000. A sample superuser is installed with credentials::
  59. username: superuser
  60. email: superuser@example.com
  61. password: testing
  62. .. _us_site:
  63. The demo site
  64. -------------
  65. The demo site is *the* reference Oscar project as it illustrates how Oscar can
  66. be redesigned and customised to build an realistic e-commerce store. The demo
  67. site is a sailing store selling a range of different product types.
  68. The customisations on top of core Oscar include:
  69. * A new skin
  70. * A variety of product types including books, clothing and downloads
  71. * Payment with PayPal Express using django-oscar-paypal_.
  72. * Payment with bankcards using Datacash using django-oscar-datacash_.
  73. .. _django-oscar-paypal: https://github.com/django-oscar/django-oscar-paypal
  74. .. _django-oscar-datacash: https://github.com/django-oscar/django-oscar-datacash
  75. .. note::
  76. Both the sandbox and demo site have the Django admin interface wired up.
  77. This is done as a convenience for developers to browse the model instances.
  78. Having said that, the Django admin interface is *unsupported* and will fail
  79. or be of little use for some models. At the time of writing, editing
  80. products in the admin is clunky and slow, and editing categories is
  81. not supported at all.
  82. Browse the external demo site
  83. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84. An instance of the demo site is built periodically (but not automatically) and
  85. available at http://demo.oscarcommerce.com. It is typically updated when new
  86. versions of Oscar are released.
  87. Run the demo site locally
  88. ~~~~~~~~~~~~~~~~~~~~~~~~~
  89. Assuming you've already set-up the sandbox site, there are two further services
  90. required to run the demo site:
  91. * A spatially aware database such as PostGIS. The demo site uses
  92. django-oscar-stores_ which requires a spatial capabilities for store searching.
  93. * A search backend that supports faceting such as Solr. You should use the
  94. sample schema file from ``sites/demo/deploy/solr/schema.xml``.
  95. Once you have set up these services, create a local settings file from a template
  96. to house your credentials:
  97. .. code-block:: bash
  98. (oscar) $ cp sites/demo/settings_local{.sample,}.py
  99. (oscar) $ vim sites/demo/settings_local.py # Add DB creds
  100. Now build the demo site:
  101. .. code-block:: bash
  102. (oscar) $ make demo
  103. (oscar) $ sites/demo/manage.py runserver
  104. The demo (initialised with a sample set of products) will be available
  105. at: http://localhost:8000.
  106. .. _django-oscar-stores: https://github.com/django-oscar/django-oscar-stores