Traceback (most recent call last):File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/serializers/json.py", line 69, in Deserializeryield from PythonDeserializer(objects, **options)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/serializers/python.py", line 91, in DeserializerModel = _get_model(d["model"])
KeyError: 'model'The above exception was the direct cause of the following exception:Traceback (most recent call last):File "manage.py", line 15, in <module>execute_from_command_line(sys.argv)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_lineutility.execute()File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in executeself.fetch_command(subcommand).run_from_argv(self.argv)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argvself.execute(*args, **cmd_options)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in executeoutput = self.handle(*args, **options)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 72, in handleself.loaddata(fixture_labels)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 113, in loaddataself.load_label(fixture_label)File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 168, in load_labelfor obj in objects:File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/serializers/json.py", line 73, in Deserializerraise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture '/Users/sparshkedia/Desktop/task/movie_rs/movies.json'
This is the above error showing when I am trying to deserialize my json file into the database.
My json file looks like this:
[{"description": "A cowboy doll is profoundly threatened and jealous when a new spaceman figure supplants him as top toy in a boy's room.","genre": "Animation,Adventure,Comedy,Family,Fantasy","imdb_url": "https://www.imdb.com/title/tt0114709/","img_url": "https://m.media-amazon.com/images/M/MV5BMDU2ZWJlMjktMTRhMy00ZTA5LWEzNDgtYmNmZTEwZTViZWJkXkEyXkFqcGdeQXVyNDQ2OTk4MzI@._V1_UX182_CR0,0,182,268_AL__QL50.jpg","movie_id": 114709,"title": "Toy Story","users_rating": 8.3,"year": 1995},{"description": "George Banks must deal not only with the pregnancy of his daughter, but also with the unexpected pregnancy of his wife.","genre": "Comedy,Family,Romance","imdb_url": "https://www.imdb.com/title/tt0113041/","img_url": "https://m.media-amazon.com/images/M/MV5BOTEyNzg5NjYtNDU4OS00MWYxLWJhMTItYWU4NTkyNDBmM2Y0XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_UX182_CR0,0,182,268_AL__QL50.jpg","movie_id": 113041,"title": "Father of the Bride Part II","users_rating": 6,"year": 1995}]
What do i need to do to feed the json file into the database? I have also created appropriate movies model which contains all the fields as per the json file.
I am using python manage.py loaddata movies.json for this. Is there any other approach, if yes please help me with it?