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.

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