· 6 years ago · Feb 04, 2019, 05:36 AM
1import os
2from datetime import timedelta
3
4DATABASES = {
5 'default': {
6 'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.postgresql'),
7 'NAME': os.environ.get('DATABASE_NAME', 'ukg'),
8 'USER': os.environ.get('DATABASE_USER', ''),
9 'PASSWORD': os.environ.get('DATABASE_PASSWORD', ''),
10 'HOST': os.environ.get('DATABASE_HOST', 'localhost'),
11 'PORT': os.environ.get('DATABASE_PORT', '5432'),
12 'ATOMIC_REQUESTS': os.environ.get('DATABASE_ATOMIC_REQUESTS', True),
13 }
14}
15
16COMMISSION_NUMBERING_PATTERN = os.environ.get(
17 'COMMISSION_NUMBERING_PATTERN',
18 "{partner.number}-{date.yyyy}-{date.mm}"
19)
20
21# POLICY_NUMBERING_PATTERN = 'TIGER-<d><Y><y><m>-<n>-<bp><p>'
22# QUOTATION_NUMBERING_PATTERN = 'QOT-<d><y>'
23POLICY_NUMBERING_PATTERN = "WPP/{number:06d}/{policy.current_version.headers_dict[source]}"
24QUOTATION_NUMBERING_PATTERN = "WPQ/{number:06d}/{policy.current_version.headers_dict[source]}"
25
26DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
27PRIVATE_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
28
29DEFAULT_FROM_EMAIL = 'noreply@tigerlab.com'
30
31EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
32EMAIL_HOST = 'smtp.gmail.com'
33EMAIL_HOST_USER = 'noreply@tigerlab.com'
34# EMAIL_HOST_PASSWORD = 'I2go2018!'
35EMAIL_HOST_PASSWORD = 'disabled'
36EMAIL_PORT = 587
37EMAIL_USE_TLS = True
38
39JWT_AUTH = {
40 # how long the original token is valid for
41 'JWT_EXPIRATION_DELTA': timedelta(days=7),
42
43 # allow refreshing of tokens
44 'JWT_ALLOW_REFRESH': True,
45
46 # this is the maximum time AFTER the token was issued that
47 # it can be refreshed. exprired tokens can't be refreshed.
48 'JWT_REFRESH_EXPIRATION_DELTA': timedelta(days=7),
49}
50
51INSURANCE_DIR = os.path.dirname(os.path.abspath(__file__))
52SRC_DIR = os.path.dirname(INSURANCE_DIR)
53
54###############################################################################
55
56template_dirs = [
57 os.path.join(SRC_DIR, 'templates'),
58]
59
60CLIENT_TEMPLATE = 'purbeck'
61# CLIENT_TEMPLATE = 'asokamas'
62CLIENT_TEMPLATE = 'peliwica'
63
64
65if CLIENT_TEMPLATE:
66 CLIENT_TEMPLATE_PATH = 'template_overrides/templates/clients/{client}'.format(
67 client=CLIENT_TEMPLATE,
68 )
69
70 template_dirs.insert(
71 0,
72 os.path.join(SRC_DIR, CLIENT_TEMPLATE_PATH)
73 )
74
75TEMPLATES = [
76 {
77 'BACKEND': 'django.template.backends.django.DjangoTemplates',
78 'DIRS': template_dirs,
79 'OPTIONS': {
80 'context_processors': [
81 'django.template.context_processors.debug',
82 'django.template.context_processors.request',
83 'django.contrib.auth.context_processors.auth',
84 'django.contrib.messages.context_processors.messages',
85 'core.context_processors.settings',
86 # 'permissions.context_processors.navigations',
87 ],
88 'loaders': [
89 'django.template.loaders.filesystem.Loader',
90 'django.template.loaders.app_directories.Loader',
91 ],
92 },
93 },
94]
95
96CUSTOM_TEMPLATE_FOLDER = os.environ.get('CUSTOM_TEMPLATE_FOLDER', None),
97if CUSTOM_TEMPLATE_FOLDER:
98 TEMPLATES[0]['DIRS'] += (CUSTOM_TEMPLATE_FOLDER, )
99
100INSTALLED_WIZARDS = [
101 {'text': 'Travel', 'icon': 'plane', 'url': 'dashboards:wizards:travel:index'},
102 {'text': 'Motor', 'icon': 'car', 'url': 'dashboards:wizards:motor:index'},
103 # {'text': 'Ktipp', 'icon': 'suitcase', 'url': 'dashboards:wizards:ktipp:index'},
104 {'text': 'Personal Guarantee', 'icon': 'suitcase', 'url': 'dashboards:wizards:purbeck:index'},
105 {'text': 'Travel', 'icon': 'plane', 'url': 'dashboards:wizards:asokamas:index'},
106 {'text': 'Travel', 'icon': 'plane', 'url': 'dashboards:wizards:buana:index'},
107 {'text': 'Peliwica Insurance', 'icon': 'suitcase', 'url': 'dashboards:wizards:peliwica:index'},
108]
109
110EXTERNAL_URL = {
111 'purbeck': {
112 'csp': 'https://purbeck-hotfix.i2go.io',
113 'rating': 'https://purbeck-rating-hotfix.i2go.io',
114 },
115}
116
117ENABLE_REFERRAL = True
118AGENT_REFERRAL_LINK = os.environ.get('AGENT_REFERRAL_LINK', 'https://purbeck-hotfix.i2go.io?rid=')
119
120###############################################################################
121
122
123SHOW_JSON_AS_DICTIONARY = False
124
125
126###############################################################################
127# PAYMENT SETTINGS
128###############################################################################
129
130PAYMENT = {
131 'STRIPE': {
132 'SECRET_KEY': 'sk_test_5yF1z4rR2yq9wonwNV2mbQup',
133 'PUBLISHABLE_KEY': 'pk_test_UM42rC1bInNuLnMIArc65HkO',
134 },
135}