shaief / openAir

Making air quality monitoring accessible
openair.dokku.shaief.com
GNU Affero General Public License v3.0
7 stars 3 forks source link

Fix naive datetime in run_scraper.py #8

Closed Nagasaki45 closed 10 years ago

Nagasaki45 commented 10 years ago

Fix the "naive datetime" warning.

yuvadm commented 10 years ago

This is because Django does not like naive date/time (i.e. one that does not mention which timezone it's in).

Use pytz to localize() the timestamp to Israeli timezone. See http://pytz.sourceforge.net/#localized-times-and-date-arithmetic

Nagasaki45 commented 10 years ago

Thanks a lot! It was an easy fix after knowing how to work with pytz. I've also updated the unicode function of the Record model to represent local time.