Thursday 15 April 2010

python - suppress django naive datetime warnings -



python - suppress django naive datetime warnings -

i concerned script involves datetime module. have suppress 'object received naive datetime while timezone active' there other print statements in script. code below

script:

from datetime import datetime date = datetime.now() objname = classname.objects.create(param=value, param=value, param=value, time=date, attachment=attachment)

models.py

class classname(models.model): t = models.datetimefield(null=true, blank=true)

how can suppress naive datetime warnings?

just disable usage of timezones, stated in documentation:

use_tz = false

python django datetime

No comments:

Post a Comment