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

sandbox.rst 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. .. spelling::
  2. uWSGI
  3. =====================
  4. Sample Oscar projects
  5. =====================
  6. Oscar ships with one sample project: a 'sandbox' site, which is a vanilla
  7. install of Oscar using the default templates and styles.
  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 made available at https://latest.oscarcommerce.com
  27. .. warning::
  28. It is possible for users to access the dashboard and edit the site content.
  29. Hence, the data can get quite messy. It is periodically cleaned up.
  30. Run the sandbox locally
  31. ~~~~~~~~~~~~~~~~~~~~~~~
  32. It's pretty straightforward to get the sandbox site running locally so you can
  33. play around with Oscar.
  34. In order to compile uWSGI, which is a dependency of the sandbox, you will
  35. first need to install the Python development headers with:::
  36. $ sudo apt install python3-dev
  37. Install Oscar and its dependencies within a virtualenv:
  38. .. code-block:: bash
  39. $ git clone https://github.com/django-oscar/django-oscar.git
  40. $ cd django-oscar
  41. $ mkvirtualenv --python=python3 oscar # needs virtualenvwrapper
  42. (oscar) $ make sandbox
  43. (oscar) $ sandbox/manage.py runserver
  44. .. warning::
  45. Note, these instructions will install the head of Oscar's 'master' branch,
  46. not an official release. Occasionally the sandbox installation process
  47. breaks while support for a new version of Django is being added (often due
  48. dependency conflicts with 3rd party libraries). Please ask on the mailing
  49. list if you have problems.
  50. If you do not have ``mkvirtualenv``, then replace that line with:
  51. .. code-block:: bash
  52. $ virtualenv --python=python3 oscar
  53. $ source ./oscar/bin/activate
  54. (oscar) $
  55. The sandbox site (initialised with a sample set of products) will be available
  56. at: http://localhost:8000. A sample superuser is installed with credentials::
  57. username: superuser
  58. email: superuser@example.com
  59. password: testing
  60. .. warning::
  61. The sandbox has Django Debug Toolbar enabled by default, which will affect
  62. its performance. You can disable it by setting ``INTERNAL_IPS`` to an
  63. empty list in your local settings.
  64. Run the sandbox using Docker
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. To run the Oscar sandbox using `Docker`_, run the following commands:
  67. .. _`Docker`: https://www.docker.com/
  68. .. code-block:: bash
  69. $ docker pull oscarcommerce/django-oscar-sandbox
  70. $ docker run -p 8080:8080/tcp oscarcommerce/django-oscar-sandbox:latest