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

sandbox.rst 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. The demo site
  25. -------------
  26. The demo site is *the* reference Oscar project as it illustrates how Oscar can
  27. be redesigned and customised to build an realistic e-commerce store. The demo
  28. site is a sailing store selling a range of different product types.
  29. The customisations on top of core Oscar include:
  30. * A new skin
  31. * A variety of product types including books, clothing and downloads
  32. * Payment with PayPal Express using django-oscar-paypal_.
  33. * Payment with bankcards using Datacash using django-oscar-datacash_.
  34. .. _django-oscar-paypal: https://github.com/tangentlabs/django-oscar-paypal
  35. .. _django-oscar-datacash: https://github.com/tangentlabs/django-oscar-datacash
  36. .. note::
  37. Both the sandbox and demo site have the Django admin interface wired up.
  38. This is done as a convenience for developers to browse the model instances.
  39. Having said that, the Django admin interface is *unsupported* and will fail
  40. or be of little use for some models. At the time of writing, editing
  41. products in the admin is clunky and slow, and editing categories is
  42. not supported at all.
  43. Browse the external sandbox site
  44. ================================
  45. An instance of the sandbox site is build hourly from master branch and made
  46. available at http://latest.oscarcommerce.com
  47. .. warning::
  48. It is possible for users to access the dashboard and edit the site content.
  49. Hence, the data can get quite messy. It is periodically cleaned up.
  50. Browse the external demo site
  51. =============================
  52. An instance of the demo site is built periodically (but not automatically) and
  53. available at http://demo.oscarcommerce.com. It is typically updated when new
  54. versions of Oscar are released.
  55. Running the sandbox locally
  56. ===========================
  57. It's pretty straightforward to get the sandbox site running locally so you can
  58. play around with Oscar.
  59. Install Oscar and its dependencies within a virtualenv:
  60. .. code-block:: bash
  61. $ git clone https://github.com/tangentlabs/django-oscar.git
  62. $ cd django-oscar
  63. $ mkvirtualenv oscar # needs virtualenvwrapper
  64. (oscar) $ make sandbox
  65. (oscar) $ sites/sandbox/manage.py runserver
  66. If you do not have ``mkvirtualenv``, then replace that line with:
  67. .. code-block:: bash
  68. $ virtualenv oscar
  69. $ . ./oscar/bin/activate
  70. (oscar) $
  71. The sandbox site (initialised with a sample set of products) will be available
  72. at: http://localhost:8000. A sample superuser is installed with credentials::
  73. username: superuser
  74. email: superuser@example.com
  75. password: testing
  76. Running the demo locally
  77. ========================
  78. Assuming you've already set-up the sandbox site, there are two further services
  79. required to run the demo site:
  80. * A spatially aware database such as PostGIS. The demo site uses
  81. django-oscar-stores_ which requires a spatial capabilities for store searching.
  82. * A search backend that supports faceting such as Solr. You should use the
  83. sample schema file from ``sites/demo/deploy/solr/schema.xml``.
  84. Once you have set up these services, create a local settings file from a template
  85. to house your credentials:
  86. .. code-block:: bash
  87. (oscar) $ cp sites/demo/settings_local{.sample,}.py
  88. (oscar) $ vim sites/demo/settings_local.py # Add DB creds
  89. Now build the demo site:
  90. .. code-block:: bash
  91. (oscar) $ make demo
  92. (oscar) $ sites/demo/manage.py runserver
  93. The demo (initialised with a sample set of products) will be available
  94. at: http://localhost:8000.
  95. .. _django-oscar-stores: https://github.com/tangentlabs/django-oscar-stores