15👍
✅
I put this in my local_settings.py:
#ignore the following error when using ipython:
#/django/db/backends/sqlite3/base.py:50: RuntimeWarning:
#SQLite received a naive datetime (2012-11-02 11:20:15.156506) while time zone support is active.
import warnings
import exceptions
warnings.filterwarnings("ignore", category=exceptions.RuntimeWarning, module='django.db.backends.sqlite3.base', lineno=53)
12👍
I have the same issue but I don’t think that it’s really a problem. IPython seems to use naive datetimes internally and Django just warns about it. Django always sends this warning when you turn on timezone support and whenever it detects a naive datetime. On my machine, this warning only appears when I start or close IPython. This warning does not influence your work with IPython in any way. So you can safely create aware datetimes normally inside IPython and also save them to your database. In order to get rid of that warning, you probably would have to work on IPython’s internals.
When working with aware datetimes in general, I strongly recommend to use pytz for this purpose.
- Error: command 'x86_64-linux-gnu-gcc' when installing mysqlclient
- Django REST framework – multiple lookup fields?
- Django select_related for multiple foreign keys
- Django : Formset as form field
- Get only certain fields of related object in Django
- Django logging requests
- Use of unicode in Django
- Django-registration, template
Source:stackexchange.com