3
votes

Erreur de désérialisation Django Problème lors de l'installation du luminaire

[
  {
    "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
  }]

0 commentaires

3 Réponses :



1
votes

Parfois, les objets ne sont pas fermés correctement

  • ouvrez le fichier JSON, regardez les erreurs mises en évidence par pycharmIDE.
  • si des objets ne sont pas fermés, corrigez-le manuellement.

0 commentaires

0
votes

J'avais des instructions d'impression dans manage.py. Cette sortie était enregistrée dans le fichier json de l'appareil qui générait une erreur de format. La suppression de ces instructions d'impression l'a résolu. Voici mon ancien fichier .json (mauvais format). J'ai supprimé la première ligne et cela a fonctionné.

app.yaml file = dev_app.yaml
[
  {
    "model": "plans.planslevel1",
    "pk": 1,
    "fields": {
      "name": "abc",
      "description": "xyz"
    }
  
  }]


0 commentaires