aws / aws/chalice

Flask Pagination is not working with Chalice

Open
#1,996 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Hey all,

Still having issues with Flask Pagination. It's not working with Chalice, is there any other way to implement Pagination, or workarounds?

```python
from chalice import Chalice

app = Chalice(app_name='aws-chalice-tutorial')

@app.route('/pagination')
def pagination():
app.log.debug("you are in Pagination!")
return {
'page': app.current_request.query_params.get('page'),
'limit': app.current_request.query_params.get('limit'),
}
```

I get the following:

```python
RuntimeError: Working outside of request context.

This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.
```

Thanks everyone,
Montana Mendy

Contributor guide

Open the contributing guide

Research direction

Begin with the reported /pagination route and the Flask Pagination integration described in the issue; reproduce the RuntimeError using the supplied Chalice example. Compare Chalice's request access with Flask Pagination's expectations, then document a supported pagination approach or a confirmed incompatibility and its workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, flask, python
Domain
api, backend, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.