ButterCMS / flask-cms-blog-example

Flask CMS-powered blog example https://buttercms.com/flask-cms
7 stars 4 forks source link

response = client.posts.all({'page': 1, 'page_size': 10}) KeyError: 'data' #9

Open Daniyaldehleh opened 2 years ago

Daniyaldehleh commented 2 years ago

Had to upgrade requirement.txt:

buttercms-python
click
Flask
Flask-Script
itsdangerous
Jinja2
MarkupSafe
requests
Werkzeug

as old Werkzeug was giving error. After adding, api key & going to /blog, I get:

Traceback (most recent call last):
  File "/Users/daniyaldehleh/Desktop/flask-cms-blog-example/env/lib/python3.8/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/daniyaldehleh/Desktop/flask-cms-blog-example/env/lib/python3.8/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/daniyaldehleh/Desktop/flask-cms-blog-example/env/lib/python3.8/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/daniyaldehleh/Desktop/flask-cms-blog-example/env/lib/python3.8/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/daniyaldehleh/Desktop/flask-cms-blog-example/buttercms/blog_blueprint.py", line 17, in home
    response = client.posts.all({'page': 1, 'page_size': 10})
KeyError: 'data'
jakelumetta commented 2 years ago

Thanks @Daniyaldehleh ! Could you open a pull request with the updates you made to requirements.txt to get things running properly and we'll take a look?