title: How to accept timezone in Postgres database using Django
body: <p>I have a model </p>
  
  <p>models.py</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  from django.db import models
  
  from django.utils import timezone
  
  class Article(models.Model):
       sort = models.IntegerField(blank=True)
       pub_date = models.DateTimeField(default=timezone.now)
       title = models.CharField(max_length=30, blank=True)
  </code></pre>
  
  <p>common.py</p>
  
  <pre><code> TIME_ZONE = 'America/New_York'
   USE_TZ = True
  </code></pre>
  
  <p>local.py</p>
  
  <pre><code> from .common import *
  
   CELERY_BROKER_URL = env('REDIS_URL')
   CELERY_RESULT_BACKEND = env('REDIS_URL')
  
   CELERY_ACCEPT_CONTENT = ['application/json']
   CELERY_TASK_SERIALIZER = 'json'
   CELERY_RESULT_SERIALIZER = 'json'
   CELERY_TIMEZONE = TIME_ZONE
  </code></pre>
  
  <p>production.py</p>
  
  <pre><code> from .common import *
  
   CELERY_BROKER_URL = env('REDIS_URL')
   CELERY_RESULT_BACKEND = env('REDIS_URL')
  
   CELERY_ACCEPT_CONTENT = ['application/json']
   CELERY_TASK_SERIALIZER = 'json'
   CELERY_RESULT_SERIALIZER = 'json'
   CELERY_TIMEZONE = TIME_ZONE
  </code></pre>
  
  <p>tasks.py</p>
  
  <pre><code> from __future__ import absolute_import, unicode_literals
   from celery.decorators import task
  
   from .models import Article
  
   import urllib2
   import json
   import datetime
  
   @task(name="articles")
   def update_article():
  
   # .... more code
   article = Article.objects.get(id=1)
         if article != None:
              article.pub_date = datetime.datetime.now()
              article.title = "Hello"
              article.save()
  </code></pre>
  
  <p>When I run in the django shell</p>
  
  <pre><code> import datetime
   pub_date = datetime.datetime.now()
   print pub_date
  </code></pre>
  
  <p>The pub_date is EST / 'America/New_York' timezone - correct.</p>
  
  <p>I have a celery to update the Article, I wrote a simple code</p>
  
  <pre><code>article.pub_date = datetime.datetime.now()
  </code></pre>
  
  <p>When the pub_date is updated, in the DB the date is in UTC not America/New_York / EST timezone, even the shell is showing me correct ETC, but running it with the task, in the postgres DB it is UTC</p>