Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

sandbox.rst 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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/django-oscar/django-oscar.git
  43. $ cd django-oscar
  44. $ mkvirtualenv oscar # needs virtualenvwrapper
  45. (oscar) $ make sandbox
  46. (oscar) $ sites/sandbox/manage.py runserver
  47. .. warning::
  48. Note, these instructions will install the head of Oscar's 'master' branch,
  49. not an official release. Occasionally the sandbox installation process
  50. breaks while support for a new version of Django is being added (often due
  51. dependency conflicts with 3rd party libraries). Please ask on the mailing
  52. list if you have problems.
  53. If you do not have ``mkvirtualenv``, then replace that line with:
  54. .. code-block:: bash
  55. $ virtualenv oscar
  56. $ source ./oscar/bin/activate
  57. (oscar) $
  58. The sandbox site (initialised with a sample set of products) will be available
  59. at: http://localhost:8000. A sample superuser is installed with credentials::
  60. username: superuser
  61. email: superuser@example.com
  62. password: testing
  63. .. _us_site:
  64. The US site
  65. -----------
  66. The US site is a relatively simple Oscar that makes a few key customisations in
  67. order to mimic how sites in the US work. Specifically, it:
  68. - Overrides the partner app to supply a new strategy selector which ensures all
  69. prices are return without taxes.
  70. - Overrides the checkout app in order to apply taxes to submissions once the
  71. shipping address is known.
  72. To browse the US site locally run:
  73. .. code-block:: bash
  74. (oscar) $ make us_site
  75. (oscar) $ sites/us/manage.py runserver
  76. and the US site will be browsable at http://localhost:8000
  77. The demo site
  78. -------------
  79. The demo site is *the* reference Oscar project as it illustrates how Oscar can
  80. be redesigned and customised to build an realistic e-commerce store. The demo
  81. site is a sailing store selling a range of different product types.
  82. The customisations on top of core Oscar include:
  83. * A new skin
  84. * A variety of product types including books, clothing and downloads
  85. * Payment with PayPal Express using django-oscar-paypal_.
  86. * Payment with bankcards using Datacash using django-oscar-datacash_.
  87. .. _django-oscar-paypal: https://github.com/django-oscar/django-oscar-paypal
  88. .. _django-oscar-datacash: https://github.com/django-oscar/django-oscar-datacash
  89. .. note::
  90. Both the sandbox and demo site have the Django admin interface wired up.
  91. This is done as a convenience for developers to browse the model instances.
  92. Having said that, the Django admin interface is *unsupported* and will fail
  93. or be of little use for some models. At the time of writing, editing
  94. products in the admin is clunky and slow, and editing categories is
  95. not supported at all.
  96. Browse the external demo site
  97. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. An instance of the demo site is built periodically (but not automatically) and
  99. available at http://demo.oscarcommerce.com. It is typically updated when new
  100. versions of Oscar are released.
  101. Run the demo site locally
  102. ~~~~~~~~~~~~~~~~~~~~~~~~~
  103. Assuming you've already set-up the sandbox site, there are two further services
  104. required to run the demo site:
  105. * A spatially aware database such as PostGIS. The demo site uses
  106. django-oscar-stores_ which requires a spatial capabilities for store searching.
  107. * A search backend that supports faceting such as Solr. You should use the
  108. sample schema file from ``sites/demo/deploy/solr/schema.xml``.
  109. Once you have set up these services, create a local settings file from a template
  110. to house your credentials:
  111. .. code-block:: bash
  112. (oscar) $ cp sites/demo/settings_local{.sample,}.py
  113. (oscar) $ vim sites/demo/settings_local.py # Add DB creds
  114. Now build the demo site:
  115. .. code-block:: bash
  116. (oscar) $ make demo
  117. (oscar) $ sites/demo/manage.py runserver
  118. The demo (initialised with a sample set of products) will be available
  119. at: http://localhost:8000.
  120. .. _django-oscar-stores: https://github.com/django-oscar/django-oscar-stores