Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

settings.py 7.2KB

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