Skip to main content

Yet another pagination class for DRF to set host address by header

Project description

DRF Link Navigation Pagination

Yet another thirdy party package for DRF Pagination.

If you want to change de host address located on next and previous fields, then this is the right thing to you. Take this body as an example:

{
  "links": {
    "next": "http://localhost/api/v1/entities/?limit=1&offset=2",
    "previous": "http://localhost/api/v1/entities/limit=1"
  },
  "count": 100,
  "results": [
    {
      "id": "bc6c6868-4e4d-4381-a785-f353ee7ecce5"
    }
  ]
}

Using a reverse proxy (like AWS API Gateway) to intermediate between your API, adding X-Drf-Change-Domain=chumaco header to the request will make the client receive the following:

{
  "links": {
    "next": "http://chumaco/api/v1/entities/?limit=1&offset=2",
    "previous": "http://chumaco/api/v1/entities/limit=1"
  },
  "count": 100,
  "results": [
    {
      "id": "bc6c6868-4e4d-4381-a785-f353ee7ecce5"
    }
  ]
}

Configuration process

Not yet fully available, but feel free to see our tests to get insights.

Tests

In order to execute the tests:

pipenv run tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for drf-link-navigation-pagination, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size drf_link_navigation_pagination-0.0.4-py3-none-any.whl (8.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size drf-link-navigation-pagination-0.0.4.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page