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.

settings.rst 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. ==============
  2. Oscar settings
  3. ==============
  4. This is a comprehensive list of all the settings Oscar provides. All settings
  5. are optional.
  6. Display settings
  7. ================
  8. ``OSCAR_SHOP_NAME``
  9. -------------------
  10. Default: ``Oscar``
  11. The name of your e-commerce shop site.
  12. ``OSCAR_SHOP_TAGLINE``
  13. ----------------------
  14. Default: ``Domain-driven e-Commerce for Django``
  15. The tagline that is displayed next to the shop name and in the browser title.
  16. ``OSCAR_PARTNER_WRAPPERS``
  17. --------------------------
  18. Default: ``{}``
  19. This is an important setting which defines availability for each fulfillment
  20. partner. The setting should be a dict from parter name to a path to a "wrapper"
  21. class. For example::
  22. OSCAR_PARTNER_WRAPPERS = {
  23. 'Acme': 'myproject.partners.AcmeWrapper'
  24. 'Omnicorp': 'myproject.partners.OmnicorpWrapper'
  25. }
  26. The wrapper class should subclass ``oscar.apps.partner.wrappers.DefaultWrapper``
  27. and override the appropriate methods to control availability behaviour.
  28. ``OSCAR_RECENTLY_VIEWED_PRODUCTS``
  29. ----------------------------------
  30. Default: 20
  31. The number of recently viewed products to store.
  32. ``OSCAR_PRODUCTS_PER_PAGE``
  33. ---------------------------
  34. Default: 20
  35. The number of products to paginate by.
  36. ``OSCAR_SEARCH_SUGGEST_LIMIT``
  37. ------------------------------
  38. Default: 10
  39. The number of suggestions that the search 'suggest' function should return
  40. at maximum.
  41. ``OSCAR_PROMOTION_POSITIONS``
  42. -----------------------------
  43. Default::
  44. OSCAR_PROMOTION_POSITIONS = (('page', 'Page'),
  45. ('right', 'Right-hand sidebar'),
  46. ('left', 'Left-hand sidebar'))
  47. The choice of display locations available when editing a promotion. Only
  48. useful when using a new set of templates.
  49. ``OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES``
  50. ---------------------------------------------
  51. Default::
  52. COUNTDOWN, LIST, SINGLE_PRODUCT, TABBED_BLOCK = (
  53. 'Countdown', 'List', 'SingleProduct', 'TabbedBlock')
  54. OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES = (
  55. (COUNTDOWN, "Vertical list"),
  56. (LIST, "Horizontal list"),
  57. (TABBED_BLOCK, "Tabbed block"),
  58. (SINGLE_PRODUCT, "Single product"),
  59. )
  60. Defines the available promotion block types that can be used in Oscar.
  61. ``OSCAR_DASHBOARD_NAVIGATION``
  62. ------------------------------
  63. Default: see ``oscar.defaults`` (too long to include here).
  64. A list of dashboard navigation elements. Usage is explained in
  65. :doc:`/howto/how_to_configure_the_dashboard_navigation`.
  66. Order settings
  67. ==============
  68. ``OSCAR_INITIAL_ORDER_STATUS``
  69. ------------------------------
  70. The initial status used when a new order is submitted. This has to be a status
  71. that is defined in the ``OSCAR_ORDER_STATUS_PIPELINE``.
  72. ``OSCAR_INITIAL_LINE_STATUS``
  73. -----------------------------
  74. The status assigned to a line item when it is created as part of an new order. It
  75. has to be a status defined in ``OSCAR_ORDER_STATUS_PIPELINE``.
  76. ``OSCAR_ORDER_STATUS_PIPELINE``
  77. -------------------------------
  78. Default: ``{}``
  79. The pipeline defines the statuses that an order or line item can have and what
  80. transitions are allowed in any given status. The pipeline is defined as a
  81. dictionary where the keys are the available statuses. Allowed transitions are
  82. defined as iterable values for the corresponding status.
  83. A sample pipeline (as used in the Oscar sandbox) might look like this::
  84. OSCAR_INITIAL_ORDER_STATUS = 'Pending'
  85. OSCAR_INITIAL_LINE_STATUS = 'Pending'
  86. OSCAR_ORDER_STATUS_PIPELINE = {
  87. 'Pending': ('Being processed', 'Cancelled',),
  88. 'Being processed': ('Processed', 'Cancelled',),
  89. 'Cancelled': (),
  90. }
  91. ``OSCAR_ORDER_STATUS_CASCADE``
  92. ------------------------------
  93. This defines a mapping of status changes for order lines which 'cascade' down
  94. from an order status change.
  95. For example::
  96. OSCAR_ORDER_STATUS_CASCADE = {
  97. 'Being processed': 'In progress'
  98. }
  99. With this mapping, when an order has it's status set to 'Being processed', all
  100. lines within it have their status set to 'In progress'. In a sense, the status
  101. change cascades down to the related objects.
  102. Note that this cascade ignores restrictions from the
  103. ``OSCAR_LINE_STATUS_PIPELINE``.
  104. ``OSCAR_LINE_STATUS_PIPELINE``
  105. ------------------------------
  106. Default: ``{}``
  107. Same as ``OSCAR_ORDER_STATUS_PIPELINE`` but for lines.
  108. Checkout settings
  109. =================
  110. ``OSCAR_ALLOW_ANON_CHECKOUT``
  111. -----------------------------
  112. Default: ``False``
  113. Specifies if an anonymous user can buy products without creating an account
  114. first. If set to ``False`` users are required to authenticate before they can
  115. checkout (using Oscar's default checkout views).
  116. ``OSCAR_REQUIRED_ADDRESS_FIELDS``
  117. ---------------------------------
  118. Default: ``('first_name', 'last_name', 'line1', 'city', 'postcode', 'country')``
  119. List of form fields that a user has to fill out to validate an address field.
  120. Review settings
  121. ===============
  122. ``OSCAR_ALLOW_ANON_REVIEWS``
  123. ----------------------------
  124. Default: ``True``
  125. This setting defines whether an anonymous user can create a review for
  126. a product without registering first. If it is set to ``True`` anonymous
  127. users can create product reviews.
  128. ``OSCAR_MODERATE_REVIEWS``
  129. --------------------------
  130. Default: ``False``
  131. This defines whether reviews have to be moderated before they are publicly
  132. available. If set to ``False`` a review created by a customer is immediately
  133. visible on the product page.
  134. Communication settings
  135. ======================
  136. ``OSCAR_EAGER_ALERTS``
  137. ----------------------
  138. Default: ``True``
  139. This enables sending alert notifications/emails instantly when products get
  140. back in stock by listening to stock record update signals this might impact
  141. performance for large numbers stock record updates.
  142. Alternatively, the management command ``oscar_send_alerts`` can be used to
  143. run periodically, e.g. as a cronjob. In this case instant alerts should be
  144. disabled.
  145. ``OSCAR_SEND_REGISTRATION_EMAIL``
  146. ---------------------------------
  147. Default: ``True``
  148. Sending out *welcome* messages to a user after they have registered on the
  149. site can be enabled or disabled using this setting. Setting it to ``True``
  150. will send out emails on registration.
  151. ``OSCAR_FROM_EMAIL``
  152. --------------------
  153. Default: ``oscar@example.com``
  154. The email address used as the sender for all communication events and emails
  155. handled by Oscar.
  156. ``OSCAR_STATIC_BASE_URL``
  157. -------------------------
  158. Default: ``None``
  159. A URL which is passed into the templates for communication events. It is not
  160. used in Oscar's default templates but could be used to include static assets
  161. (eg images) in a HTML email template.
  162. Offer settings
  163. ==============
  164. ``OSCAR_OFFER_BLACKLIST_PRODUCT``
  165. ---------------------------------
  166. Default: ``None``
  167. A function which takes a product as its sole parameter and returns a boolean
  168. indicating if the product is blacklisted from offers or not.
  169. Example::
  170. from decimal import Decimal as D
  171. def is_expensive(product):
  172. if product.has_stockrecord:
  173. return product.stockrecord.price_incl_tax < D('1000.00')
  174. return False
  175. # Don't allow expensive products to be in offers
  176. OSCAR_OFFER_BLACKLIST_PRODUCT = is_expensive
  177. ``OSCAR_OFFER_ROUNDING_FUNCTION``
  178. ---------------------------------
  179. Default: Round down to the nearest hundredth of a unit using ``decimal.Decimal.quantize``
  180. A function responsible for rounding decimal amounts when offer discount
  181. calculations don't lead to legitimate currency values.
  182. Basket settings
  183. ===============
  184. ``OSCAR_BASKET_COOKIE_LIFETIME``
  185. --------------------------------
  186. Default: 604800 (1 week in seconds)
  187. The time to live for the basket cookie in seconds.
  188. ``OSCAR_MAX_BASKET_QUANTITY_THRESHOLD``
  189. ---------------------------------------
  190. Default: ``None``
  191. The maximum number of products that can be added to a basket at once.
  192. ``OSCAR_BASKET_COOKIE_OPEN``
  193. ----------------------------
  194. Default: ``oscar_open_basket``
  195. ``OSCAR_BASKET_COOKIE_SAVED``
  196. -----------------------------
  197. Default: ``oscar_saved_basket``
  198. Currency settings
  199. =================
  200. ``OSCAR_DEFAULT_CURRENCY``
  201. --------------------------
  202. Default: ``GBP``
  203. This should be the symbol of the currency you wish Oscar to use by default.
  204. This will be used by the currency templatetag.
  205. ``OSCAR_CURRENCY_LOCALE``
  206. -------------------------
  207. Default: ``None``
  208. This can be used to customise currency formatting. The value will be passed to
  209. the ``format_currency`` function from the `Babel library`_.
  210. .. _`Babel library`: http://babel.edgewall.org/wiki/ApiDocs/0.9/babel.numbers#babel.numbers:format_decimal
  211. ``OSCAR_CURRENCY_FORMAT``
  212. -------------------------
  213. Default: ``None``
  214. This can be used to customise currency formatting. The value will be passed to
  215. the ``format_currency`` function from the Babel library.
  216. Upload/media settings
  217. =====================
  218. ``OSCAR_IMAGE_FOLDER``
  219. ----------------------
  220. Default: ``images/products/%Y/%m/``
  221. The location within the ``MEDIA_ROOT`` folder that is used to store product images.
  222. The folder name can contain date format strings as described in the `Django Docs`_.
  223. .. _`Django Docs`: https://docs.djangoproject.com/en/dev/ref/models/fields/#filefield
  224. ``OSCAR_PROMOTION_FOLDER``
  225. --------------------------
  226. Default: ``images/promotions/``
  227. The folder within ``MEDIA_ROOT`` used for uploaded promotion images.
  228. ``OSCAR_MISSING_IMAGE_URL``
  229. ---------------------------
  230. Default: ``image_not_found.jpg``
  231. Copy this image from ``oscar/static/img`` to your ``MEDIA_ROOT`` folder. It needs to
  232. be there so Sorl can resize it.
  233. ``OSCAR_UPLOAD_ROOT``
  234. ---------------------
  235. Default: ``/tmp``
  236. The folder is used to temporarily hold uploaded files until they are processed.
  237. Such files should always be deleted afterwards.
  238. Slug settings
  239. =============
  240. ``OSCAR_SLUG_MAP``
  241. ------------------
  242. Default: ``None``
  243. A dictionary to map strings to more readable versions for including in URL
  244. slugs. This mapping is appled before the slugify function.
  245. This is useful when names contain characters which would normally be
  246. stripped. For instance::
  247. OSCAR_SLUG_MAP = {
  248. 'c++': 'cpp',
  249. 'f#': 'fshared',
  250. }
  251. ``OSCAR_SLUG_FUNCTION``
  252. -----------------------
  253. Default: ``django.template.defaultfilters.slugify``
  254. The slugify function to use. Note that is used within Oscar's slugify wrapper
  255. (in ``oscar.core.utils``) which applies the custom map and blacklist.
  256. Example::
  257. def some_slugify(value)
  258. pass
  259. OSCAR_SLUG_FUNCTION = some_slugify
  260. ``OSCAR_SLUG_BLACKLIST``
  261. ------------------------
  262. Default: ``None``
  263. A list of words to exclude from slugs.
  264. Example::
  265. OSCAR_SLUG_BLACKLIST = ['the', 'a', 'but']
  266. Misc settings
  267. =============
  268. ``OSCAR_COOKIES_DELETE_ON_LOGOUT``
  269. ----------------------------------
  270. Default: ``['oscar_recently_viewed_products',]``
  271. Which cookies to delete automatically when the user logs out.