rentgeeen rentgeeen - 6 months ago 20
Python Question

How to hide herokuapp.com site built in Django when the site is live

Let's say we have an app in Django (python environment)

example.herokuapp.com


and we put the site live

example.com


how to achieve that the site is not accessible via

example.herokuapp.com


I do not want anyone to access it that way in case someone would be trying to.

Is there a way?

Answer

In order to hide

example.herokuapp.com

from the django live site

example.com

set

ALLOWED_HOSTS=['example.com']

For polishing the website to the top detail, create beautiful custom 500.html template.