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.

config.py 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import os
  2. from django.conf import settings, global_settings
  3. from oscar import OSCAR_CORE_APPS
  4. def configure():
  5. if not settings.configured:
  6. from oscar.defaults import OSCAR_SETTINGS
  7. # Helper function to extract absolute path
  8. location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
  9. settings.configure(
  10. DATABASES={
  11. 'default': {
  12. 'ENGINE': 'django.db.backends.sqlite3',
  13. 'NAME': ':memory:',
  14. }
  15. },
  16. INSTALLED_APPS=[
  17. 'django.contrib.auth',
  18. 'django.contrib.admin',
  19. 'django.contrib.contenttypes',
  20. 'django.contrib.sessions',
  21. 'django.contrib.sites',
  22. 'django.contrib.flatpages',
  23. 'sorl.thumbnail',
  24. ] + OSCAR_CORE_APPS,
  25. TEMPLATE_CONTEXT_PROCESSORS=(
  26. "django.contrib.auth.context_processors.auth",
  27. "django.core.context_processors.request",
  28. "django.core.context_processors.debug",
  29. "django.core.context_processors.i18n",
  30. "django.core.context_processors.media",
  31. "django.core.context_processors.static",
  32. "django.contrib.messages.context_processors.messages",
  33. 'oscar.apps.search.context_processors.search_form',
  34. 'oscar.apps.promotions.context_processors.promotions',
  35. 'oscar.apps.checkout.context_processors.checkout',
  36. ),
  37. TEMPLATE_DIRS=(
  38. location('templates'),
  39. ),
  40. MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES + (
  41. 'oscar.apps.basket.middleware.BasketMiddleware',
  42. ),
  43. AUTHENTICATION_BACKENDS=(
  44. 'oscar.apps.customer.auth_backends.Emailbackend',
  45. 'django.contrib.auth.backends.ModelBackend',
  46. ),
  47. ROOT_URLCONF='tests.site.urls',
  48. LOGIN_REDIRECT_URL='/accounts/',
  49. DEBUG=False,
  50. SITE_ID=1,
  51. HAYSTACK_SEARCH_ENGINE='dummy',
  52. HAYSTACK_SITECONF = 'oscar.search_sites',
  53. APPEND_SLASH=True,
  54. NOSE_ARGS=['-s', '-x', '--with-spec'],
  55. **OSCAR_SETTINGS
  56. )