@@ -1,136 +1,136 | |||||
1 | """ |
|
1 | """ | |
2 | Django settings for realtime project. |
|
2 | Django settings for realtime project. | |
3 |
|
3 | |||
4 | Generated by 'django-admin startproject' using Django 1.11.7. |
|
4 | Generated by 'django-admin startproject' using Django 1.11.7. | |
5 |
|
5 | |||
6 | For more information on this file, see |
|
6 | For more information on this file, see | |
7 | https://docs.djangoproject.com/en/1.11/topics/settings/ |
|
7 | https://docs.djangoproject.com/en/1.11/topics/settings/ | |
8 |
|
8 | |||
9 | For the full list of settings and their values, see |
|
9 | For the full list of settings and their values, see | |
10 | https://docs.djangoproject.com/en/1.11/ref/settings/ |
|
10 | https://docs.djangoproject.com/en/1.11/ref/settings/ | |
11 | """ |
|
11 | """ | |
12 |
|
12 | |||
13 | import os |
|
13 | import os | |
14 |
|
14 | |||
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | # Quick-start development settings - unsuitable for production |
|
19 | # Quick-start development settings - unsuitable for production | |
20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ |
|
20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ | |
21 |
|
21 | |||
22 | # SECURITY WARNING: keep the secret key used in production secret! |
|
22 | # SECURITY WARNING: keep the secret key used in production secret! | |
23 | SECRET_KEY = '-rgo(&lgs^!4jn6atk_^=!a)+jtt%%h48a_w5-csgn7jc@iao5' |
|
23 | SECRET_KEY = '-rgo(&lgs^!4jn6atk_^=!a)+jtt%%h48a_w5-csgn7jc@iao5' | |
24 |
|
24 | |||
25 | # SECURITY WARNING: don't run with debug turned on in production! |
|
25 | # SECURITY WARNING: don't run with debug turned on in production! | |
26 | DEBUG = True |
|
26 | DEBUG = True | |
27 |
|
27 | |||
28 | ALLOWED_HOSTS = ['*'] #YONG |
|
28 | ALLOWED_HOSTS = ['*'] #YONG | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | # Application definition |
|
31 | # Application definition | |
32 |
|
32 | |||
33 | INSTALLED_APPS = [ |
|
33 | INSTALLED_APPS = [ | |
34 | 'django.contrib.admin', |
|
34 | 'django.contrib.admin', | |
35 | 'django.contrib.auth', |
|
35 | 'django.contrib.auth', | |
36 | 'django.contrib.contenttypes', |
|
36 | 'django.contrib.contenttypes', | |
37 | 'django.contrib.sessions', |
|
37 | 'django.contrib.sessions', | |
38 | 'django.contrib.messages', |
|
38 | 'django.contrib.messages', | |
39 | 'django.contrib.staticfiles', |
|
39 | 'django.contrib.staticfiles', | |
40 | 'bootstrap3', |
|
40 | 'bootstrap3', | |
41 | 'channels', |
|
41 | 'channels', | |
42 | 'plotter', |
|
42 | 'plotter', | |
43 | ] |
|
43 | ] | |
44 |
|
44 | |||
45 | MIDDLEWARE = [ |
|
45 | MIDDLEWARE = [ | |
46 | 'django.middleware.security.SecurityMiddleware', |
|
46 | 'django.middleware.security.SecurityMiddleware', | |
47 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
47 | 'django.contrib.sessions.middleware.SessionMiddleware', | |
48 | 'django.middleware.common.CommonMiddleware', |
|
48 | 'django.middleware.common.CommonMiddleware', | |
49 | 'django.middleware.csrf.CsrfViewMiddleware', |
|
49 | 'django.middleware.csrf.CsrfViewMiddleware', | |
50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
51 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
51 | 'django.contrib.messages.middleware.MessageMiddleware', | |
52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', | |
53 | ] |
|
53 | ] | |
54 |
|
54 | |||
55 | ROOT_URLCONF = 'realtime.urls' |
|
55 | ROOT_URLCONF = 'realtime.urls' | |
56 |
|
56 | |||
57 | TEMPLATES = [ |
|
57 | TEMPLATES = [ | |
58 | { |
|
58 | { | |
59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|
59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
60 | 'DIRS': [], |
|
60 | 'DIRS': [], | |
61 | 'APP_DIRS': True, |
|
61 | 'APP_DIRS': True, | |
62 | 'OPTIONS': { |
|
62 | 'OPTIONS': { | |
63 | 'context_processors': [ |
|
63 | 'context_processors': [ | |
64 | 'django.template.context_processors.debug', |
|
64 | 'django.template.context_processors.debug', | |
65 | 'django.template.context_processors.request', |
|
65 | 'django.template.context_processors.request', | |
66 | 'django.contrib.auth.context_processors.auth', |
|
66 | 'django.contrib.auth.context_processors.auth', | |
67 | 'django.contrib.messages.context_processors.messages', |
|
67 | 'django.contrib.messages.context_processors.messages', | |
68 | ], |
|
68 | ], | |
69 | }, |
|
69 | }, | |
70 | }, |
|
70 | }, | |
71 | ] |
|
71 | ] | |
72 |
|
72 | |||
73 | WSGI_APPLICATION = 'realtime.wsgi.application' |
|
73 | WSGI_APPLICATION = 'realtime.wsgi.application' | |
74 |
|
74 | |||
75 |
|
75 | |||
76 | # Database |
|
76 | # Database | |
77 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases |
|
77 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases | |
78 |
|
78 | |||
79 | DATABASES = { |
|
79 | DATABASES = { | |
80 | 'default': { |
|
80 | 'default': { | |
81 | 'ENGINE': 'django.db.backends.sqlite3', |
|
81 | 'ENGINE': 'django.db.backends.sqlite3', | |
82 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
|
82 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } | |
85 |
|
85 | |||
86 |
|
86 | |||
87 | # Password validation |
|
87 | # Password validation | |
88 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators |
|
88 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators | |
89 |
|
89 | |||
90 | AUTH_PASSWORD_VALIDATORS = [ |
|
90 | AUTH_PASSWORD_VALIDATORS = [ | |
91 | { |
|
91 | { | |
92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
|
92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | |
93 | }, |
|
93 | }, | |
94 | { |
|
94 | { | |
95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
|
95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | |
96 | }, |
|
96 | }, | |
97 | { |
|
97 | { | |
98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
|
98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | |
99 | }, |
|
99 | }, | |
100 | { |
|
100 | { | |
101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
|
101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', | |
102 | }, |
|
102 | }, | |
103 | ] |
|
103 | ] | |
104 |
|
104 | |||
105 |
|
105 | |||
106 | # Internationalization |
|
106 | # Internationalization | |
107 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ |
|
107 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ | |
108 |
|
108 | |||
109 | LANGUAGE_CODE = 'en-us' |
|
109 | LANGUAGE_CODE = 'en-us' | |
110 |
|
110 | |||
111 | TIME_ZONE = 'UTC' |
|
111 | TIME_ZONE = os.environ.get('TZ', 'UTC') | |
112 |
|
112 | |||
113 | USE_I18N = True |
|
113 | USE_I18N = True | |
114 |
|
114 | |||
115 | USE_L10N = True |
|
115 | USE_L10N = True | |
116 |
|
116 | |||
117 | USE_TZ = True |
|
117 | USE_TZ = True | |
118 |
|
118 | |||
119 |
|
119 | |||
120 | # Static files (CSS, JavaScript, Images) |
|
120 | # Static files (CSS, JavaScript, Images) | |
121 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ |
|
121 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ | |
122 |
|
122 | |||
123 | STATIC_URL = '/static/' |
|
123 | STATIC_URL = '/static/' | |
124 |
|
124 | |||
125 | #======================== YONG ================================ |
|
125 | #======================== YONG ================================ | |
126 | host = os.environ.get('HOST_REDIS', '127.0.0.1') |
|
126 | host = os.environ.get('HOST_REDIS', '127.0.0.1') | |
127 |
|
127 | |||
128 | CHANNEL_LAYERS = { |
|
128 | CHANNEL_LAYERS = { | |
129 | "default": { |
|
129 | "default": { | |
130 | "BACKEND": "asgi_redis.RedisChannelLayer", |
|
130 | "BACKEND": "asgi_redis.RedisChannelLayer", | |
131 | "CONFIG": { |
|
131 | "CONFIG": { | |
132 | "hosts": [(host, 6379)], |
|
132 | "hosts": [(host, 6379)], | |
133 | }, |
|
133 | }, | |
134 | "ROUTING": "realtime.routing.channel_routing", |
|
134 | "ROUTING": "realtime.routing.channel_routing", | |
135 | }, |
|
135 | }, | |
136 | } |
|
136 | } |
General Comments 0
You need to be logged in to leave comments.
Login now