settings.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import os
  2. import django
  3. from django.conf import global_settings
  4. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  5. SECRET_KEY = '!DJANGO_JET_TESTS!'
  6. DEBUG = True
  7. TEMPLATE_DEBUG = DEBUG
  8. DEBUG_PROPAGATE_EXCEPTIONS = True
  9. ROOT_URLCONF = 'jet.tests.urls'
  10. INSTALLED_APPS = (
  11. 'jet.dashboard',
  12. 'jet',
  13. 'django.contrib.auth',
  14. 'django.contrib.contenttypes',
  15. 'django.contrib.sessions',
  16. 'django.contrib.sites',
  17. 'django.contrib.messages',
  18. 'django.contrib.admin',
  19. 'jet.tests',
  20. )
  21. MIDDLEWARE = MIDDLEWARE_CLASSES = (
  22. 'django.contrib.sessions.middleware.SessionMiddleware',
  23. 'django.middleware.common.CommonMiddleware',
  24. 'django.middleware.csrf.CsrfViewMiddleware',
  25. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  26. 'django.contrib.messages.middleware.MessageMiddleware',
  27. )
  28. if django.VERSION[:2] < (1, 9):
  29. TEMPLATE_CONTEXT_PROCESSORS = tuple(global_settings.TEMPLATE_CONTEXT_PROCESSORS) + (
  30. 'django.core.context_processors.request',
  31. )
  32. else:
  33. TEMPLATES = [
  34. {
  35. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  36. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  37. 'APP_DIRS': True,
  38. 'OPTIONS': {
  39. 'context_processors': (
  40. 'django.template.context_processors.debug',
  41. 'django.template.context_processors.request',
  42. 'django.contrib.auth.context_processors.auth',
  43. 'django.contrib.messages.context_processors.messages',
  44. )
  45. },
  46. },
  47. ]
  48. DATABASES = {
  49. 'default': {
  50. 'ENGINE': 'django.db.backends.sqlite3',
  51. }
  52. }
  53. TIME_ZONE = 'UTC'
  54. LANGUAGE_CODE = 'en-US'
  55. USE_I18N = True
  56. USE_L10N = True
  57. MEDIA_ROOT = ''
  58. MEDIA_URL = ''
  59. STATIC_URL = '/static/'
  60. JET_INDEX_DASHBOARD = 'jet.tests.dashboard.TestIndexDashboard'
  61. JET_APP_INDEX_DASHBOARD = 'jet.tests.dashboard.TestAppIndexDashboard'