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

settings_quickstart.py 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. import os
  2. PROJECT_DIR = os.path.dirname(__file__)
  3. location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
  4. DEBUG = True
  5. TEMPLATE_DEBUG = True
  6. SQL_DEBUG = True
  7. ADMINS = (
  8. # ('Your Name', 'your_email@domain.com'),
  9. )
  10. EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  11. MANAGERS = ADMINS
  12. DATABASES = {
  13. 'default': {
  14. 'ENGINE': 'django.db.backends.sqlite3',
  15. 'NAME': '/tmp/oscar_vanilla',
  16. 'USER': '',
  17. 'PASSWORD': '',
  18. 'HOST': '',
  19. 'PORT': '',
  20. }
  21. }
  22. # Local time zone for this installation. Choices can be found here:
  23. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  24. # although not all choices may be available on all operating systems.
  25. # On Unix systems, a value of None will cause Django to use the same
  26. # timezone as the operating system.
  27. # If running in a Windows environment this must be set to the same as your
  28. # system time zone.
  29. TIME_ZONE = 'Europe/London'
  30. # Language code for this installation. All choices can be found here:
  31. # http://www.i18nguy.com/unicode/language-identifiers.html
  32. LANGUAGE_CODE = 'en-us'
  33. SITE_ID = 1
  34. # If you set this to False, Django will make some optimizations so as not
  35. # to load the internationalization machinery.
  36. USE_I18N = True
  37. # If you set this to False, Django will not format dates, numbers and
  38. # calendars according to the current locale
  39. USE_L10N = True
  40. # Absolute path to the directory that holds media.
  41. # Example: "/home/media/media.lawrence.com/"
  42. MEDIA_ROOT = location("assets")
  43. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  44. # trailing slash if there is a path component (optional in other cases).
  45. # Examples: "http://media.lawrence.com", "http://example.com/media/"
  46. MEDIA_URL = '/media/'
  47. # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  48. # trailing slash.
  49. # Examples: "http://foo.com/media/", "/media/".
  50. ADMIN_MEDIA_PREFIX = '/media/admin/'
  51. # Make this unique, and don't share it with anybody.
  52. SECRET_KEY = '$)a7n&o80u!6y5t-+jrd3)3!%vh&shg$wqpjpxc!ar&p#!)n1a'
  53. # List of callables that know how to import templates from various sources.
  54. TEMPLATE_LOADERS = (
  55. 'django.template.loaders.filesystem.Loader',
  56. 'django.template.loaders.app_directories.Loader',
  57. )
  58. TEMPLATE_CONTEXT_PROCESSORS = (
  59. "django.contrib.auth.context_processors.auth",
  60. "django.core.context_processors.request",
  61. "django.core.context_processors.debug",
  62. "django.core.context_processors.i18n",
  63. "django.core.context_processors.media",
  64. "django.core.context_processors.static",
  65. "django.contrib.messages.context_processors.messages",
  66. # Oscar specific
  67. 'oscar.apps.search.context_processors.search_form',
  68. 'oscar.apps.promotions.context_processors.promotions',
  69. 'oscar.apps.promotions.context_processors.merchandising_blocks',
  70. )
  71. MIDDLEWARE_CLASSES = (
  72. 'django.middleware.common.CommonMiddleware',
  73. 'django.contrib.sessions.middleware.SessionMiddleware',
  74. 'django.middleware.csrf.CsrfViewMiddleware',
  75. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  76. 'django.contrib.messages.middleware.MessageMiddleware',
  77. 'django.middleware.transaction.TransactionMiddleware',
  78. 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
  79. # Oscar specific
  80. 'oscar.apps.basket.middleware.BasketMiddleware'
  81. )
  82. INTERNAL_IPS = ('127.0.0.1',)
  83. ROOT_URLCONF = 'urls'
  84. TEMPLATE_DIRS = (
  85. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  86. # Always use forward slashes, even on Windows.
  87. # Don't forget to use absolute paths, not relative paths.
  88. )
  89. # A sample logging configuration. The only tangible logging
  90. # performed by this configuration is to send an email to
  91. # the site admins on every HTTP 500 error.
  92. # See http://docs.djangoproject.com/en/dev/topics/logging for
  93. # more details on how to customize your logging configuration.
  94. LOGGING = {
  95. 'version': 1,
  96. 'disable_existing_loggers': False,
  97. 'formatters': {
  98. 'verbose': {
  99. 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
  100. },
  101. 'simple': {
  102. 'format': '%(levelname)s %(message)s'
  103. },
  104. },
  105. 'handlers': {
  106. 'null': {
  107. 'level':'DEBUG',
  108. 'class':'django.utils.log.NullHandler',
  109. },
  110. 'console':{
  111. 'level':'DEBUG',
  112. 'class':'logging.StreamHandler',
  113. 'formatter': 'verbose'
  114. },
  115. 'file': {
  116. 'level': 'INFO',
  117. 'class': 'logging.FileHandler',
  118. 'filename': '/tmp/oscar.log',
  119. 'formatter': 'verbose'
  120. },
  121. 'mail_admins': {
  122. 'level': 'ERROR',
  123. 'class': 'django.utils.log.AdminEmailHandler',
  124. },
  125. },
  126. 'loggers': {
  127. 'django': {
  128. 'handlers':['null'],
  129. 'propagate': True,
  130. 'level':'INFO',
  131. },
  132. 'django.request': {
  133. 'handlers': ['mail_admins'],
  134. 'level': 'ERROR',
  135. 'propagate': False,
  136. },
  137. 'oscar.checkout': {
  138. 'handlers': ['console'],
  139. 'propagate': True,
  140. 'level':'INFO',
  141. },
  142. 'django.db.backends': {
  143. 'handlers':['null'],
  144. 'propagate': False,
  145. 'level':'DEBUG',
  146. },
  147. }
  148. }
  149. INSTALLED_APPS = (
  150. 'django.contrib.auth',
  151. 'django.contrib.contenttypes',
  152. 'django.contrib.sessions',
  153. 'django.contrib.sites',
  154. 'django.contrib.messages',
  155. 'django.contrib.admin',
  156. 'django.contrib.flatpages',
  157. # External dependencies
  158. 'haystack',
  159. 'sorl.thumbnail',
  160. # Apps from oscar
  161. 'oscar',
  162. 'oscar.apps.analytics',
  163. 'oscar.apps.discount',
  164. 'oscar.apps.order',
  165. 'oscar.apps.checkout',
  166. 'oscar.apps.shipping',
  167. 'oscar.apps.order_management',
  168. 'oscar.apps.product',
  169. 'oscar.apps.basket',
  170. 'oscar.apps.payment',
  171. 'oscar.apps.offer',
  172. 'oscar.apps.address',
  173. 'oscar.apps.partner',
  174. 'oscar.apps.image',
  175. 'oscar.apps.customer',
  176. 'oscar.apps.promotions',
  177. 'oscar.apps.reports',
  178. 'oscar.apps.search',
  179. 'oscar.apps.product.reviews',
  180. 'oscar.apps.payment.datacash',
  181. )
  182. LOGIN_REDIRECT_URL = '/accounts/profile/'
  183. APPEND_SLASH = True
  184. # Oscar settings
  185. from oscar.defaults import *
  186. # Haystack settings
  187. HAYSTACK_SITECONF = 'oscar.search_sites'
  188. HAYSTACK_SEARCH_ENGINE = 'dummy'