dba1ab21b261a9400ebb16794037f5f24709431a
[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 TEMPLATE_DEBUG = False
31
32 # Application definition
33 AUTHENTICATION_BACKENDS = (
34   'samples.auth_backend.HTSUserModelBackend', )
35 CUSTOM_USER_MODEL = 'samples.HTSUser'
36
37 INSTALLED_APPS = [
38     'django.contrib.admin',
39     'django.contrib.auth',
40     'django.contrib.contenttypes',
41     'django.contrib.sessions',
42     'django.contrib.messages',
43     'django.contrib.staticfiles',
44     'django.contrib.humanize',
45     'rest_framework',
46
47     'eland_config',
48     'samples',
49     'experiments',
50     'bcmagic',
51     'inventory',
52     'labels',
53 ]
54
55 MIDDLEWARE_CLASSES = [
56     'django.contrib.sessions.middleware.SessionMiddleware',
57     'django.middleware.common.CommonMiddleware',
58     'django.middleware.csrf.CsrfViewMiddleware',
59     'django.contrib.auth.middleware.AuthenticationMiddleware',
60     'django.contrib.messages.middleware.MessageMiddleware',
61     'django.middleware.clickjacking.XFrameOptionsMiddleware',
62 ]
63
64 TEMPLATE_DIRS = [
65     join(DJANGO_ROOT, 'templates'),
66 ]
67
68 ROOT_URLCONF = 'htsworkflow.urls'
69
70 WSGI_APPLICATION = 'wsgi.application'
71
72 # Database
73 # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
74
75 EMAIL_HOST = 'localhost'
76
77 # Internationalization
78 # https://docs.djangoproject.com/en/1.6/topics/i18n/
79
80 LANGUAGE_CODE = 'en-us'
81
82 TIME_ZONE='America/Los_Angeles'
83
84 USE_I18N = True
85
86 USE_L10N = True
87
88 USE_TZ = True
89
90 # Static files (CSS, JavaScript, Images)
91 # https://docs.djangoproject.com/en/1.6/howto/static-files/
92 STATICFILES_DIRS = (
93     join(DJANGO_ROOT, 'static'),
94 )
95 STATIC_URL = '/static/'
96
97 ###
98 # Application specific settings
99 DEFAULT_PM = 5
100
101 # How often to recheck the result archive
102 RESCAN_DELAY=1
103
104 # configure who is sending email and who should get BCCs of announcments
105 NOTIFICATION_SENDER = "noreply@example.com"
106 NOTIFICATION_BCC=[]
107
108 # Update this in settings_local to point to your flowcell result directory
109 RESULT_HOME_DIR = join(PROJECT_ROOT, 'test', 'result', 'flowcells')
110
111
112 REST_FRAMEWORK = {
113     'DEFAULT_PAGINATION_SERIALIZER_CLASS': 'rest_framework.pagination.PaginationSerializer',
114     'PAGINATE_BY' : 25,
115 }