Issue #4 new

Still seem to be issues with jsonfield - AttributeError: 'module' object has no attribute 'fields'

Anonymous created an issue


Trying to install this really useful sounding app for a project.

Using pip, I get django-sms-gateway 1.2.1 and django-jsonfield 0.9.10

But then trying to do a syncdb gives me this:

File "/usr/local/lib/python2.7/dist-packages/sms/models/", line 22, in Gateway
    settings = jsonfield.fields.JSONField(default={},
AttributeError: 'module' object has no attribute 'fields'

and if I downgrade django-jsonfield to 0.9.2 (which you say should work, in one of the other issues), then I get the sql error that is logged against that issue.

I'm using Python 2.7 and django 1.4.1, with MySQL on the backend.

Any ideas what's going wrong?

Comments (8)

  1. Simon Woolf

    Thanks, I've installed from the trunk, but now that jsonfield.fields is being properly imported, it's generating an error when trying to import django.utils six :

    File "/usr/local/lib/python2.7/dist-packages/jsonfield/", line 8, in <module>
        from django.utils import six
    ImportError: cannot import name six

    Doesn't make much sense, trying to resolve it but if this means anything to you please let me know!

  2. Simon Woolf

    So.... if I replace the import statements in jsonfields and with just

    import six (which works)

    Then I'm back to the sql error that other people have mentioned:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uuid,\n    `status` varchar(16) NOT NULL,\n    `status_message` varchar(128),\n    ' at line 8"
  3. maxgatedigital

    I got past the jsonfield.fields issue by using django 1.5.1 instead of django 1.4

    I got past the MySQL error last mentioned by installing django-uuidfield with pip

  4. Simon Woolf

    Confirming that maxgatedigital's solution works for me too - and with the 1.2.1 version of django-sms-gateway, not the trunk

    Ie: upgraded django, uninstalled django-uuidfield and then reinstalled using pip

  5. maxgatedigital

    it might just be the 'syncdb' bit with django 1.4.x and django-jsonfield... ie once you have everything working, the current django-jsonfield will work with 1.4.x? Anyway - we've moved onto 1.5.x and syncdb works with django-jsonfield

  6. Log in to comment