-1

I just wanted to upload my django project on digitalocean, but ran into multiple problems, of which I can not solve the last one.

I am using a restframework. After getting an error, that there is

No module named rest_framework.views 

I installed it, but get the next error:

AttributeError at /
'module' object has no attribute 'JSONField'

Simply installing JSONField does not change anything. I think it still has to do with the restframework module.

/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py in <module>
ModelSerializer.serializer_field_mapping[postgres_fields.JSONField] = JSONField 

I have been trying to solve it for hours already but nothing helps...

Has someone had the same problem or knows how to fix it?

Thanks a lot and kind regards views.py

settings.py

error p1 error p2

Marcel
  • 72
  • 1
  • 3
  • 11
  • 1
    Could you show how you import the JSONField ? your INSTALLED_APPS and just to be sure do you use a postgres ? – user2021091 Nov 24 '17 at 09:10
  • 1
    And show what you're doing to "install" rest_framework.views and JSONField. – Daniel Roseman Nov 24 '17 at 09:23
  • i just added sceenshots of my project to the post. thanks so much for your help guys. Its really getting frustrating over here -.- – Marcel Nov 24 '17 at 09:47
  • Possible duplicate of [Djano JSON field. 'module' object has no attribute 'JSONField'](https://stackoverflow.com/questions/38513827/djano-json-field-module-object-has-no-attribute-jsonfield) – Laxmikant Ratnaparkhi Nov 24 '17 at 09:48
  • saw the post already but none of the measures solved the problem – Marcel Nov 24 '17 at 09:50

1 Answers1

0

I guess the error is the way you do:

import JSONField

Just delete that line.

Then you won't be able to use it because you're using sqlite3. here's a tutorial to use postgres.

user2021091
  • 561
  • 2
  • 11