Commit 20ed1e7a5715e29052a5f319d5c72af4bdfb0d93
1 parent
b4e8963c
Exists in
dev
bugfixed time saved in db tables
L'heure sauvegardée dans les tables weatherwatch et sitewatch (updated) était en UTC alors que le django setting est en UTC+1 (France). C'est maintenant la bonne heure qui est sauvée !!!
Showing
6 changed files
with
27 additions
and
6 deletions
Show diff stats
README.md
... | ... | @@ -64,7 +64,7 @@ LAST VERSION |
64 | 64 | |
65 | 65 | Date: 13/03/2018 |
66 | 66 | By: E. Pallier |
67 | -Version: 0.16.7 | |
67 | +Version: 0.16.8 | |
68 | 68 | - each agent (envmonitor, majordome, alert) can be started independently with a script (new script start_agent in each agent directory) |
69 | 69 | - new command "pyros start" to start pyros in different ways (different options : everything or only some components) |
70 | 70 | ... | ... |
src/monitoring/start_agent_monitoring.py
... | ... | @@ -13,8 +13,12 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.pyros.settings") |
13 | 13 | #os.environ['SECRET_KEY'] = 'abc' |
14 | 14 | #os.environ['ENVIRONMENT'] = 'production' |
15 | 15 | import django |
16 | + | |
16 | 17 | django.setup() |
17 | 18 | |
19 | +#import datetime | |
20 | +#print(datetime.datetime.now()) | |
21 | + | |
18 | 22 | # MONITORING AGENT setup |
19 | 23 | agent="monitoring" |
20 | 24 | ... | ... |
src/monitoring/tasks.py
src/pyros/settings.py
... | ... | @@ -142,7 +142,7 @@ if not CELERY_TEST: |
142 | 142 | 'PASSWORD': 'DjangoPyros', |
143 | 143 | } |
144 | 144 | } |
145 | - | |
145 | + | |
146 | 146 | # CELERY_TEST = False ==> 'TEST' RUN MODE, use pyros_test database |
147 | 147 | else: |
148 | 148 | DATABASES = { |
... | ... | @@ -178,16 +178,27 @@ AUTH_PASSWORD_VALIDATORS = [ |
178 | 178 | # Internationalization |
179 | 179 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ |
180 | 180 | |
181 | -LANGUAGE_CODE = 'en-us' | |
182 | 181 | |
183 | -TIME_ZONE = 'UTC' | |
182 | +#LANGUAGE_CODE = 'en-us' | |
183 | +LANGUAGE_CODE = 'fr-FR' | |
184 | + | |
185 | +#TIME_ZONE = 'UTC' | |
186 | +TIME_ZONE = 'Europe/Paris' | |
184 | 187 | |
188 | +# If you set this to False, Django will make some optimizations so as not | |
189 | +# to load the internationalization machinery. | |
185 | 190 | USE_I18N = True |
186 | 191 | |
192 | +# If you set this to False, Django will not format dates, numbers and | |
193 | +# calendars according to the current locale. | |
187 | 194 | USE_L10N = True |
188 | 195 | |
189 | -USE_TZ = True | |
190 | - | |
196 | +# EP change | |
197 | +# If you set this to False, Django will not use timezone-aware datetimes. | |
198 | +# If true => "updated" fields in weatherwatch or sitewatch will be saved as UTC time | |
199 | +# If false => "updated" fields in weatherwatch or sitewatch will be saved as UTC+1 time (French time) | |
200 | +#USE_TZ = True | |
201 | +USE_TZ = False | |
191 | 202 | |
192 | 203 | # To find the media files {{ MEDIA_URL }} |
193 | 204 | MEDIA_URL = '/public/static/media/' | ... | ... |