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.6KB

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