Getting localhost for next page url in production

hlo, I have deployed a Django rest app in production. When I call a list API there is a pagination, and I am getting localhost for next page URL.

I am using GenericViewSet and LimitOffsetPagination for pagination. My app is running in docker container.And it is pointed to a specific domain. We can access it using domain name "". But I have used python runserver:'s just for testing) CMD for running the server.

You can use relative url in your html, something like this:



<a href="/nextpage/?page=2" />

When you change to this, your url will be change to yourdomain/nextpage/?page2. So you can run your app in localhost or VM or in container without changing host or absolute url for one by one environment you set up in project.

Back to Top