title: Date ValidationError in Django
body: <p>I want to block users whose premium plan has expired after 30 days(though I might change the days later). And redirect them to the payment page. I'm doing this by checking the db if the expiry date has reached so it can block them from viewing exclusive content. I wrote the below codes to carry out the operation but I'm getting this error:</p>
  
  <pre><code>ValidationError at /owo/
  [u"'expire' value has an invalid date format. It must be in YYYY-MM-DD format."]
  </code></pre>
  
  <p>I would also like to know if this approach is the best way to carry out the operation, or I should move the code and place it in middleware.py. </p>
  
  <p>Models</p>
  
  <pre><code>class Paid(models.Model):
     user=models.ForeignKey(User)
     pub_date=models.DateTimeField()
     expire = models.DateField(_('expire'), default=None, blank=True, null=True, db_index=True)
     active=models.BooleanField(_('active'), default=False, db_index=False)
     sid=models.CharField(max_length=100,default='1303908')
     mode=models.CharField(max_length=10, default='2CO')
     li_0_type=models.CharField(max_length=100, default='Product')
     li_0_name=models.CharField(max_length=100, default='Monthly Subscription')
     li_0_price=models.CharField(max_length=100, default='500')
  
  
     def __unicode__(self):
         return self.user
  
     def is_active(self):
         return self.active
  
     def is_expired(self):
         if self.expire is None:
            return False
         else:
            return self.expire &lt; date.today()
  </code></pre>
  
  <p>Views for saving paid users:</p>
  
  <pre><code>def two_check(request):
      if request.method=="POST":
        form=PaidForm(request.POST)
        if form.is_valid():
           data=form.cleaned_data
           newtwo=Paid(
              user=request.user,
              pub_date=datetime.datetime.now(),
              expire=datetime.datetime.now()+ datetime.timedelta(days=29),
              active=data['active'],
              sid=data['sid'],
              mode=data['mode'],
              li_0_type=data['li_0_type'],
              li_0_name=data['li_0_name'],
              li_0_price=data['li_0_price'])
           newtwo.save()
           return HttpResponseRedirect('/confirm_two/')
        else:
           return HttpResponse('Oops error')
     else:
       return render_to_response('two.html'{'PaidForm':PaidForm},context_instance=RequestContext(request))
  </code></pre>
  
  <p>View for checking expired users</p>
  
  <pre><code>def check_use(request):
     d=datetime.date.today()
     if request.user.is_authenticated():
         if Paid.objects.get(expire='expire') &gt;= d.strptime("%Y-%m-%d"):
            return HttpResponseRedirect('/pay_plan/')
         else:
            return HttpResponseRedirect('/owo/')
     return render_to_response('eyowo.html',{'Paid':Paid},context_instance=RequestContext(request))
  </code></pre>