You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above warning occurs when running manage.py runcrons on Django 1.4. The complete traceback is:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in executeself.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argvself.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute
output =self.handle(*args, **options)
File "/home/joel/.virtualenvs/ecomarket/local/lib/python2.7/site-packages/django_cron/management/commands/runcrons.py", line 57, in handle
silent=options['silent'])
File "/home/joel/.virtualenvs/ecomarket/local/lib/python2.7/site-packages/django_cron/management/commands/runcrons.py", line 74, in run_cron_with_cache_check
CronJobManager.run(instance, force)
File "/home/joel/.virtualenvs/ecomarket/local/lib/python2.7/site-packages/django_cron/__init__.py", line 91, in runif CronJobManager.__should_run_now(cron_job, force):
File "/home/joel/.virtualenvs/ecomarket/local/lib/python2.7/site-packages/django_cron/__init__.py", line 78, in __should_run_now
qset = CronJobLog.objects.filter(code=cron_job.code, start_time__gt=datetime.today().date(), ran_at_time=time_data)
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 143, in filterreturnself.get_query_set().filter(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 624, in filterreturnself._filter_or_exclude(False, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 642, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1250, in add_q
can_reuse=used_aliases, force_having=force_having)
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1185, in add_filter
connector)
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 69, in add
value = obj.prepare(lookup_type, value)
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 320, in preparereturnself.field.get_prep_lookup(lookup_type, value)
File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 709, in get_prep_lookupreturnsuper(DateField, self).get_prep_lookup(lookup_type, value)
File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 310, in get_prep_lookupreturnself.get_prep_value(value)
File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 801, in get_prep_value
value =self.to_python(value)
File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 761, in to_pythonRuntimeWarning)
RuntimeWarning: DateTimeField received a naive datetime (2013-08-22 00:00:00) while time zone support is active.
This comes from the fact that you are passing a datetime.date object to a DateTimeField, which is unsupported. A workaround is to use a timezone-aware datetime object (eg. by using django.utils.timezone.now) and setting the time to midnight.
Although this is only a warning, it is causing a large amount of email for us as we have runcrons set up to run every five minutes and email us any output from stderr.
The text was updated successfully, but these errors were encountered:
/.virtualenvs/my-env/local/lib/python2.7/site-packages/django/db/models/fields/init.py:848: RuntimeWarning: DateTimeField CronJobLog.start_time received a naive datetime (2014-09-11 00:00:00) while time zone support is active.
RuntimeWarning)
The above warning occurs when running
manage.py runcrons
on Django 1.4. The complete traceback is:This comes from the fact that you are passing a
datetime.date
object to a DateTimeField, which is unsupported. A workaround is to use a timezone-awaredatetime
object (eg. by usingdjango.utils.timezone.now
) and setting the time to midnight.Although this is only a warning, it is causing a large amount of email for us as we have
runcrons
set up to run every five minutes and email us any output from stderr.The text was updated successfully, but these errors were encountered: