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