Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

settings.py 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import os
  2. import oscar
  3. from oscar.defaults import * # noqa
  4. # Path helper
  5. location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
  6. DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, }
  7. INSTALLED_APPS = [
  8. 'django.contrib.auth',
  9. 'django.contrib.admin',
  10. 'django.contrib.contenttypes',
  11. 'django.contrib.sessions',
  12. 'django.contrib.sites',
  13. 'django.contrib.flatpages',
  14. 'django.contrib.staticfiles',
  15. 'widget_tweaks',
  16. # contains models we need for testing
  17. 'tests._site.model_tests_app',
  18. 'tests._site.myauth',
  19. # Use a custom partner app to test overriding models. I can't
  20. # find a way of doing this on a per-test basis, so I'm using a
  21. # global change.
  22. ] + oscar.get_core_apps(['tests._site.apps.partner', 'tests._site.apps.customer'])
  23. AUTH_USER_MODEL = 'myauth.User'
  24. TEMPLATE_CONTEXT_PROCESSORS = (
  25. "django.contrib.auth.context_processors.auth",
  26. "django.core.context_processors.request",
  27. "django.core.context_processors.debug",
  28. "django.core.context_processors.i18n",
  29. "django.core.context_processors.media",
  30. "django.core.context_processors.static",
  31. "django.contrib.messages.context_processors.messages",
  32. 'oscar.apps.search.context_processors.search_form',
  33. 'oscar.apps.customer.notifications.context_processors.notifications',
  34. 'oscar.apps.promotions.context_processors.promotions',
  35. 'oscar.apps.checkout.context_processors.checkout',
  36. 'oscar.core.context_processors.metadata',
  37. )
  38. TEMPLATE_DIRS = (
  39. location('_site/templates'),
  40. oscar.OSCAR_MAIN_TEMPLATE_DIR,
  41. )
  42. TEMPLATE_LOADERS = (
  43. ('django.template.loaders.cached.Loader',
  44. ['django.template.loaders.filesystem.Loader',
  45. 'django.template.loaders.app_directories.Loader',
  46. 'django.template.loaders.eggs.Loader']),
  47. )
  48. MIDDLEWARE_CLASSES = (
  49. 'django.middleware.common.CommonMiddleware',
  50. 'django.contrib.sessions.middleware.SessionMiddleware',
  51. 'django.middleware.csrf.CsrfViewMiddleware',
  52. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  53. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  54. 'django.contrib.messages.middleware.MessageMiddleware',
  55. 'oscar.apps.basket.middleware.BasketMiddleware',
  56. )
  57. AUTHENTICATION_BACKENDS = (
  58. 'oscar.apps.customer.auth_backends.EmailBackend',
  59. 'django.contrib.auth.backends.ModelBackend',
  60. )
  61. HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.simple_backend.SimpleEngine'}}
  62. PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
  63. ROOT_URLCONF = 'tests._site.urls'
  64. LOGIN_REDIRECT_URL = '/accounts/'
  65. STATIC_URL = '/static/'
  66. DEBUG = False
  67. SITE_ID = 1
  68. USE_TZ = 1
  69. APPEND_SLASH = True
  70. DDF_DEFAULT_DATA_FIXTURE = 'tests.dynamic_fixtures.OscarDynamicDataFixtureClass'
  71. SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
  72. # temporary workaround for issue in sorl-thumbnail in Python 3
  73. # https://github.com/mariocesar/sorl-thumbnail/pull/254
  74. THUMBNAIL_DEBUG = False,
  75. OSCAR_INITIAL_ORDER_STATUS = 'A'
  76. OSCAR_ORDER_STATUS_PIPELINE = {'A': ('B',), 'B': ()}
  77. OSCAR_INITIAL_LINE_STATUS = 'a'
  78. OSCAR_LINE_STATUS_PIPELINE = {'a': ('b', ), 'b': ()}
  79. SECRET_KEY = 'notverysecret'
  80. TEST_RUNNER = 'django.test.runner.DiscoverRunner'