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

settings.rst 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. =======================
  2. Oscar specific settings
  3. =======================
  4. Oscar provides a number of settings used to configure the system.
  5. .. contents::
  6. :local:
  7. :depth: 1
  8. Available settings
  9. ==================
  10. OSCAR_SHOP_NAME
  11. ---------------
  12. Default: ``Oscar``
  13. The name of your e-commerce shop site.
  14. OSCAR_SHOP_TAGLINE
  15. ------------------
  16. Default: ``Domain-driven e-Commerce for Django``
  17. The tagline that is displayed next to the shop name and in the browser title
  18. OSCAR_ORDER_STATUS_PIPELINE
  19. ---------------------------
  20. The pipeline defines the statuses that an order or line item can have and what
  21. transitions are allowed in any given status. The pipeline is defined as a
  22. dictionary where the keys are the available statuses. Allowed transitions are
  23. defined as iterable values for the corresponding status. A sample pipeline
  24. (as used in the Oscar sandbox) might look like this::
  25. OSCAR_INITIAL_ORDER_STATUS = 'Pending'
  26. OSCAR_INITIAL_LINE_STATUS = 'Pending'
  27. OSCAR_ORDER_STATUS_PIPELINE = {
  28. 'Pending': ('Being processed', 'Cancelled',),
  29. 'Being processed': ('Processed', 'Cancelled',),
  30. 'Cancelled': (),
  31. }
  32. OSCAR_INITIAL_ORDER_STATUS
  33. --------------------------
  34. The initial status used when a new order is submitted. This has to be a status
  35. that is defined in the ``OSCAR_ORDER_STATUS_PIPELINE``.
  36. OSCAR_INITIAL_LINE_STATUS
  37. -------------------------
  38. The status assigned to a line item when it is created as part of an new order. It
  39. has to be a status defined in ``OSCAR_ORDER_STATUS_PIPELINE``.
  40. OSCAR_ALLOW_ANON_CHECKOUT
  41. -------------------------
  42. Default: ``False``
  43. Specifies if an anonymous user can buy products without creating an account.
  44. If set to ``False`` a registered user is required to check out.
  45. OSCAR_REQUIRED_ADDRESS_FIELDS
  46. -----------------------------
  47. Default: ``('first_name', 'last_name', 'line1', 'city', 'postcode', 'country')``
  48. List of form fields that a user has to fill out to validate an address field.
  49. OSCAR_PARTNER_WRAPPERS
  50. ----------------------
  51. Default: ``{}``
  52. OSCAR_ALLOW_ANON_REVIEWS
  53. ------------------------
  54. Default: ``True``
  55. This setting defines whether an anonymous user can create a review for
  56. a product without registering first. If it is set to ``True`` anonymous
  57. users can create product reviews.
  58. OSCAR_MODERATE_REVIEWS
  59. ----------------------
  60. Default: ``False``
  61. This defines whether reviews have to be moderated before they are publicly
  62. available. If set to ``False`` a review created by a customer is immediately
  63. visible on the product page.
  64. OSCAR_EAGER_ALERTS
  65. ------------------
  66. Default: ``True``
  67. This enables sending alert notifications/emails instantly when products get
  68. back in stock by listening to stock record update signals this might impact
  69. performance for large numbers stock record updates.
  70. Alternatively, the management command ``oscar_send_alerts`` can be used to
  71. run periodically, e.g. as a cronjob. In this case instant alerts should be
  72. disabled.
  73. OSCAR_SEND_REGISTRATION_EMAIL
  74. -----------------------------
  75. Default: ``True``
  76. Sending out *welcome* messages to a user after they have registered on the
  77. site can be enabled or disabled using this setting. Setting it to ``True``
  78. will send out emails on registration.
  79. OSCAR_FROM_EMAIL
  80. ----------------
  81. Default: ``oscar@example.com``
  82. The email address used as the sender for all communication events and emails
  83. handled by Oscar.
  84. OSCAR_OFFER_BLACKLIST_PRODUCT
  85. -----------------------------
  86. Default: ``None``
  87. OSCAR_MAX_BASKET_QUANTITY_THRESHOLD
  88. -----------------------------------
  89. Default: ``None``
  90. OSCAR_BASKET_COOKIE_OPEN
  91. ------------------------
  92. Default: ``oscar_open_basket``
  93. OSCAR_BASKET_COOKIE_SAVED
  94. -------------------------
  95. Default: ``oscar_saved_basket``
  96. OSCAR_COOKIES_DELETE_ON_LOGOUT
  97. ------------------------------
  98. Default: ``['oscar_recently_viewed_products', ]``
  99. OSCAR_DEFAULT_CURRENCY
  100. ----------------------
  101. Default: ``GBP``
  102. This should be the symbol of the currency you wish Oscar to use by default.
  103. This will be used by the currency templatetag.
  104. OSCAR_CURRENCY_LOCALE
  105. ---------------------
  106. Default: ``None``
  107. This can be used to customise currency formatting. The value will be passed to
  108. the ``format_currency`` function from the `Babel library`_.
  109. .. _`Babel library`: http://babel.edgewall.org/wiki/ApiDocs/0.9/babel.numbers#babel.numbers:format_decimal
  110. OSCAR_CURRENCY_FORMAT
  111. ---------------------
  112. Default: ``None``
  113. This can be used to customise currency formatting. The value will be passed to
  114. the ``format_currency`` function from the Babel library.
  115. OSCAR_BASKET_COOKIE_LIFETIME
  116. ----------------------------
  117. Default: 604800 (1 week in seconds)
  118. The time to live for the basket cookie in seconds
  119. OSCAR_RECENTLY_VIEWED_PRODUCTS
  120. ------------------------------
  121. Default: 20
  122. The number of recently viewed products to store
  123. OSCAR_PRODUCTS_PER_PAGE
  124. ------------------------------
  125. Default: 20
  126. The number of products to paginate by
  127. OSCAR_SEARCH_SUGGEST_LIMIT
  128. --------------------------
  129. Default: 10
  130. The number of suggestions that the search 'suggest' function should return
  131. at maximum
  132. OSCAR_IMAGE_FOLDER
  133. ------------------
  134. Default: ``images/products/%Y/%m/``
  135. The location within the ``MEDIA_ROOT`` folder that is used to store product images.
  136. The folder name can contain date format strings as described in the `Django Docs`_.
  137. .. _`Django Docs`: https://docs.djangoproject.com/en/dev/ref/models/fields/#filefield
  138. OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES
  139. -----------------------------------------
  140. Default::
  141. COUNTDOWN, LIST, SINGLE_PRODUCT, TABBED_BLOCK = (
  142. 'Countdown', 'List', 'SingleProduct', 'TabbedBlock')
  143. OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES = (
  144. (COUNTDOWN, "Vertical list"),
  145. (LIST, "Horizontal list"),
  146. (TABBED_BLOCK, "Tabbed block"),
  147. (SINGLE_PRODUCT, "Single product"),
  148. )
  149. Defines the available promotion block types that can be used in Oscar.
  150. OSCAR_PROMOTION_FOLDER
  151. ----------------------
  152. Default: ``images/promotions/``
  153. The folder within ``MEDIA_ROOT`` used for uploaded promotion images.
  154. OSCAR_PROMOTION_POSITIONS
  155. -------------------------
  156. Default::
  157. OSCAR_PROMOTION_POSITIONS = (('page', 'Page'),
  158. ('right', 'Right-hand sidebar'),
  159. ('left', 'Left-hand sidebar'))
  160. The choice of display locations available when editing a promotion. Only
  161. useful when using a new set of templates.
  162. OSCAR_MISSING_IMAGE_URL
  163. -----------------------
  164. Default: ``image_not_found.jpg``
  165. Copy this image from ``oscar/static/img`` to your ``MEDIA_ROOT`` folder. It needs to
  166. be there so Sorl can resize it.
  167. OSCAR_UPLOAD_ROOT
  168. -----------------
  169. Default: ``/tmp``
  170. OSCAR_SLUG_FUNCTION
  171. -----------------
  172. Default: django.template.defaultfilters.slugify
  173. Slugify function
  174. Example:
  175. def some_slugify(value)
  176. pass
  177. OSCAR_SLUG_FUNCTION = some_slugify
  178. Deprecated settings
  179. ===================
  180. There are currently no deprecated settings in Oscar.