title: Django unicode issue with datetime in Jython with SQLite JDBC
body: <p>I recently started a Django project using Jython. I created a virtualenv and successfully created a Django 1.8.6 project, using a JDBC file for SQLite (sqlite-jdbc-3.8.11.2).</p>
  
  <p>I could create a superuser with <code>jython manage.py createsuperuser</code>, loaded the admin URL and logged in successfully. I even could create another user from the admin. The problems begin when I tried to edit a user. The server cannot render the template of the detailed instance of the user Model.</p>
  
  <p>I have not installed any external apps, nor created an app in the project. I am using django.contrib.auth for the User models and the Django admin default interface.</p>
  
  <p>The initial error I get when I load the <code>/admin/auth/user/1/</code> is <code>'unicode' object has no attribute 'tzinfo'</code>:</p>
  
  <pre><code>AttributeError at /admin/auth/user/1/
  
  'unicode' object has no attribute 'tzinfo'
  
  Request Method: GET
  Request URL: http://localhost:8000/admin/auth/user/1/
  Django Version: 1.8.6
  Exception Type: AttributeError
  Exception Value:
  
  'unicode' object has no attribute 'tzinfo'
  
  Exception Location: /home/dmunoz/jsnmp/Lib/site-packages/django/utils/timezone.py in is_aware, line 337
  Python Executable: /home/dmunoz/jsnmp/bin/jython
  Python Version: 2.7.0
  Python Path:
  
  ['/home/dmunoz/snmp/webswitcher',
   '/home/dmunoz/jsnmp/Lib/site-packages/django_jython-1.8.0b3-py2.7.egg',
   '/home/dmunoz/jsnmp/Lib/site-packages',
   '/home/dmunoz/jsnmp/Lib',
   '/home/dmunoz/opt/jython2.7.0/Lib',
   '__classpath__',
   '__pyclasspath__/']
  
  Server time: Tue, 10 Nov 2015 12:31:09 -0300
  
  Error during template rendering
  
  In template /home/dmunoz/jsnmp/Lib/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
  </code></pre>
  
  <p>Because of this, I tried setting <code>USE_TZ = False</code> in the settings.py file. Then, I got <code>'unicode' object has no attribute 'date'</code>:</p>
  
  <pre><code>AttributeError at /admin/auth/user/1/
  
  'unicode' object has no attribute 'date'
  
  Request Method: GET
  Request URL: http://localhost:8000/admin/auth/user/1/
  Django Version: 1.8.6
  Exception Type: AttributeError
  Exception Value:
  
  'unicode' object has no attribute 'date'
  
  Exception Location: /home/dmunoz/jsnmp/Lib/site-packages/django/forms/widgets.py in decompress, line 888
  Python Executable: /home/dmunoz/jsnmp/bin/jython
  Python Version: 2.7.0
  Python Path:
  
  ['/home/dmunoz/snmp/webswitcher',
   '/home/dmunoz/jsnmp/Lib/site-packages/django_jython-1.8.0b3-py2.7.egg',
   '/home/dmunoz/jsnmp/Lib/site-packages',
   '/home/dmunoz/jsnmp/Lib',
   '/home/dmunoz/opt/jython2.7.0/Lib',
   '__classpath__',
   '__pyclasspath__/']
  
  Server time: Tue, 10 Nov 2015 12:28:18 -0300
  
  Error during template rendering
  
  In template /home/dmunoz/jsnmp/Lib/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
  </code></pre>
  
  <p>The final error I have got is when I tried to dump the data from auth.User model with <code>jython manage.py dumpdata auth.User --indent=4 --traceback</code>:</p>
  
  <pre><code>[Traceback (most recent call last):
    File "manage.py", line 10, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
      utility.execute()
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/management/__init__.py", line 346, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/management/base.py", line 394, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/management/base.py", line 445, in execute
      output = self.handle(*args, **options)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/management/commands/dumpdata.py", line 159, in handle
      serializers.serialize(format, get_objects(), indent=indent,
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/serializers/__init__.py", line 129, in serialize
      s.serialize(queryset, **options)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/serializers/base.py", line 61, in serialize
      self.handle_field(obj, field)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/core/serializers/python.py", line 55, in handle_field
      self._current[field.name] = field.value_to_string(obj)
    File "/home/dmunoz/jsnmp/Lib/site-packages/django/db/models/fields/__init__.py", line 1487, in value_to_string
      return '' if val is None else val.isoformat()
  AttributeError: 'unicode' object has no attribute 'isoformat'
  </code></pre>
  
  <p>Python version: 2.7.0, 
  Jython version: 2.7.0, 
  Django version: 1.8.6, 
  django-jython version: 1.8.0b3, 
  SQLITE JDBC version: 3.8.11.2</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I created a Django App, with a single and simple model:</p>
  
  <pre><code>from django.db import models
  
  class PMV(models.Model):
      creation_date = models.DateField()
  </code></pre>
  
  <p>I created an instance in the admin web page, with Date = today. When I tried to edit it, I got this:</p>
  
  <p><a href="https://i.stack.imgur.com/1Psba.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Psba.png" alt="Screenshot from admin, model with DateField"></a></p>
  
  <p>After this, I added a <code>models.DateTimeField()</code> to the PMV model, created an instance and tried to edit it. I got the <code>'unicode' object has no attribute 'tzinfo'</code> error again.</p>