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.py 7.0KB

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