Update template configuration for Django 1.9
[htsworkflow.git] / htsworkflow / settings / base.py
1 """
2 Django settings for wsgiexample project.
3
4 For more information on this file, see
5 https://docs.djangoproject.com/en/1.6/topics/settings/
6
7 For the full list of settings and their values, see
8 https://docs.djangoproject.com/en/1.6/ref/settings/
9 """
10
11 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12 from os.path import abspath, basename, dirname, join, normpath
13 import sys
14 import logging
15
16 from htsworkflow.util import config_helper
17
18 DJANGO_ROOT = dirname(dirname(abspath(__file__)))
19 PROJECT_ROOT = dirname(DJANGO_ROOT)
20
21 INI_OPTIONS = config_helper.HTSWConfig()
22
23 SECRET_KEY = INI_OPTIONS.setdefaultsecret('frontend', 'secret_key')
24 DEFAULT_API_KEY = INI_OPTIONS.setdefaultsecret('frontend', 'api')
25
26 # SECURITY WARNING: don't run with debug turned on in production!
27 # Override in settings_local
28 DEBUG = False
29
30 TEMPLATES = [
31     {
32         'BACKEND': 'django.template.backends.django.DjangoTemplates',
33         'DIRS': [join(DJANGO_ROOT, 'templates'),],
34         'APP_DIRS': True,
35         'OPTIONS': {
36             'context_processors': [
37                 'django.contrib.auth.context_processors.auth',
38                 'django.template.context_processors.debug',
39                 'django.template.context_processors.i18n',
40                 'django.template.context_processors.media',
41                 'django.template.context_processors.static',
42                 'django.template.context_processors.tz',
43                 'django.contrib.messages.context_processors.messages',
44             ],
45         },
46     },
47 ]
48
49 # Application definition
50 #AUTHENTICATION_BACKENDS = (
51 #  'samples.auth_backend.HTSUserModelBackend', )
52 #CUSTOM_USER_MODEL = 'samples.HTSUser'
53
54 INSTALLED_APPS = [
55     'django.contrib.admin',
56     'django.contrib.auth',
57     'django.contrib.contenttypes',
58     'django.contrib.sessions',
59     'django.contrib.messages',
60     'django.contrib.staticfiles',
61     'django.contrib.humanize',
62
63     'eland_config',
64     'samples',
65     'experiments',
66     'bcmagic',
67     'inventory',
68     'labels',
69 ]
70
71 MIDDLEWARE_CLASSES = [
72     'django.contrib.sessions.middleware.SessionMiddleware',
73     'django.middleware.common.CommonMiddleware',
74     'django.middleware.csrf.CsrfViewMiddleware',
75     'django.contrib.auth.middleware.AuthenticationMiddleware',
76     'django.contrib.messages.middleware.MessageMiddleware',
77     'django.middleware.clickjacking.XFrameOptionsMiddleware',
78 ]
79
80 ROOT_URLCONF = 'htsworkflow.urls'
81
82 WSGI_APPLICATION = 'wsgi.application'
83
84 # Database
85 # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
86
87 EMAIL_HOST = 'localhost'
88
89 # Internationalization
90 # https://docs.djangoproject.com/en/1.6/topics/i18n/
91
92 LANGUAGE_CODE = 'en-us'
93
94 TIME_ZONE='America/Los_Angeles'
95
96 USE_I18N = True
97
98 USE_L10N = True
99
100 USE_TZ = True
101
102 # Static files (CSS, JavaScript, Images)
103 # https://docs.djangoproject.com/en/1.6/howto/static-files/
104 STATICFILES_DIRS = (
105     join(DJANGO_ROOT, 'static'),
106 )
107 STATIC_URL = '/static/'
108
109 ###
110 # Application specific settings
111 DEFAULT_PM = 5
112
113 # How often to recheck the result archive
114 RESCAN_DELAY=1
115
116 # configure who is sending email and who should get BCCs of announcments
117 NOTIFICATION_SENDER = "noreply@example.com"
118 NOTIFICATION_BCC=[]
119
120 # Update this in settings_local to point to your flowcell result directory
121 RESULT_HOME_DIR = join(PROJECT_ROOT, 'test', 'result', 'flowcells')