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

settings.py 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. MANAGERS = ADMINS
  12. DATABASES = {
  13. 'default': {
  14. 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  15. 'NAME': '', # Or path to database file if using sqlite3.
  16. 'USER': '', # Not used with sqlite3.
  17. 'PASSWORD': '', # Not used with sqlite3.
  18. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  19. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  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. # 'django.template.loaders.eggs.Loader',
  58. )
  59. TEMPLATE_CONTEXT_PROCESSORS = (
  60. "django.contrib.auth.context_processors.auth",
  61. "django.core.context_processors.request",
  62. "django.core.context_processors.debug",
  63. "django.core.context_processors.i18n",
  64. "django.core.context_processors.media",
  65. "django.core.context_processors.static",
  66. "django.contrib.messages.context_processors.messages",
  67. # Oscar specific
  68. 'oscar.promotions.context_processors.promotions',
  69. )
  70. MIDDLEWARE_CLASSES = (
  71. 'django.middleware.common.CommonMiddleware',
  72. 'django.contrib.sessions.middleware.SessionMiddleware',
  73. 'django.middleware.csrf.CsrfViewMiddleware',
  74. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  75. #'debug_toolbar.middleware.DebugToolbarMiddleware',
  76. 'django.contrib.messages.middleware.MessageMiddleware',
  77. 'django.middleware.transaction.TransactionMiddleware',
  78. 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
  79. )
  80. INTERNAL_IPS = ('127.0.0.1',)
  81. ROOT_URLCONF = 'urls'
  82. TEMPLATE_DIRS = (
  83. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  84. # Always use forward slashes, even on Windows.
  85. # Don't forget to use absolute paths, not relative paths.
  86. )
  87. # A sample logging configuration. The only tangible logging
  88. # performed by this configuration is to send an email to
  89. # the site admins on every HTTP 500 error.
  90. # See http://docs.djangoproject.com/en/dev/topics/logging for
  91. # more details on how to customize your logging configuration.
  92. LOGGING = {
  93. 'version': 1,
  94. 'disable_existing_loggers': False,
  95. 'handlers': {
  96. 'mail_admins': {
  97. 'level': 'ERROR',
  98. 'class': 'django.utils.log.AdminEmailHandler'
  99. }
  100. },
  101. 'loggers': {
  102. 'django.request':{
  103. 'handlers': ['mail_admins'],
  104. 'level': 'ERROR',
  105. 'propagate': True,
  106. },
  107. }
  108. }
  109. INSTALLED_APPS = (
  110. 'django.contrib.auth',
  111. 'django.contrib.contenttypes',
  112. 'django.contrib.sessions',
  113. 'django.contrib.sites',
  114. 'django.contrib.messages',
  115. 'django.contrib.admin',
  116. 'django.contrib.flatpages',
  117. # External apps
  118. 'django_extensions',
  119. #'debug_toolbar',
  120. # Apps from oscar
  121. 'oscar',
  122. 'oscar.analytics',
  123. 'oscar.discount',
  124. 'oscar.order',
  125. 'oscar.checkout',
  126. 'oscar.shipping',
  127. 'oscar.order_management',
  128. 'oscar.product',
  129. 'oscar.basket',
  130. 'oscar.payment',
  131. 'oscar.offer',
  132. 'oscar.address',
  133. 'oscar.stock',
  134. 'oscar.image',
  135. 'oscar.customer',
  136. 'oscar.promotions',
  137. 'oscar.reports',
  138. )
  139. LOGIN_REDIRECT_URL = '/shop/accounts/profile/'
  140. APPEND_SLASH = True
  141. # Oscar settings
  142. OSCAR_DEFAULT_CURRENCY = 'GBP'
  143. # Max number of products to keep on the user's history
  144. OSCAR_RECENTLY_VIEWED_PRODUCTS = 4
  145. # Local overrides
  146. try:
  147. from local_settings import *
  148. except ImportError:
  149. pass