Это мой код:
from flask import Flask, render_template
from post import Post
import requests
posts = requests.get("https://api.npoint.io/5abcca6f4e39b4955965").json()
post_objects = []
for post in posts:
post_obj = Post(post['id'], post["title"], post["subtitle"], post["body"])
post_objects.append(post_obj) ~~~~^^^^^^
Обнаружена следующая ошибка:
TypeError: string indices must be integers, not 'str'
Подробнее здесь: https://stackoverflow.com/questions/787 ... pplication