1

I have a web URL which I can access only after I have added an entry into the /etc/hosts file which was in the format:

<IP> <URL>

But now I want to replicate the same thing in an online django application on heroku.

How do I replicate this with code, either some library on python or some procedure on heroku?

BarcaBoy
  • 11
  • 3
  • Access the URL by IP and set the `Host` header manually. – Klaus D. Apr 12 '21 at 07:29
  • @Selcuk I guess he is asking something different then setting up a hosting domain. In my interpretation he tries to request a URL with some faulty/missing DNS name. – Klaus D. Apr 12 '21 at 07:33
  • @KlausD. Yes exactly, I have an application running which isn't the issue, this application is trying to read another URL which isn't directly exposed to the internet – BarcaBoy Apr 12 '21 at 07:39
  • I have reopened the question. It wasn't very clear from the wording. Please post the relevant portion of your code, especially the part where you call the `urllib`, `requests` or similar. You can't modify `/etc/hosts` on Heroku but you can use an IP to make an HTTP request. – Selcuk Apr 12 '21 at 07:55
  • I am using selenium, it is for a web-scraping application. I haven't added any code concerning this as I do not know how to proceed, hoping to get some guidance – BarcaBoy Apr 12 '21 at 08:02

0 Answers0