I have a DateField in a Django 1.8 model, something like:
from django.db import models
birth_date = models.DateField()
When it goes onto a form, I get back a 'naive' object:
birth_date = the_form.cleaned_data['birth_date']
Printing birth_date in the debugger:
ipdb> birth_date
datetime.date(2015, 6, 7)
Then when this thing is saved to a database, I get a warning, as the documentation promises:
RuntimeWarning: SQLite received a naive datetime (2015-06-08 01:08:21.470719) while time zone support is active.
I've read some articles on this, and I am still confused. What should I do with this date?
Should I convert it to a DateTime, make it timezone-aware, then back into a Date? Should I make the model a DateTimeField and abandon DateFields? What are best practices here?
I think that you can try to use make_aware to convert the date to aware format. From make_aware django documentation:
This should fix the warning: