Alien13
Alien13

Reputation: 618

Referencing host url in settings.py

this is a really basic question, but I cannot seem to find the answer on the internet.

In settings.py I have a line that looks like this.

settings.py

LOGIN_REDIRECT_URL = 'http://localhost:8000/profile'

Obviously having "localhost" is not very stable when pushing into production. And everytime I deploy it the URL changes. How to I reference the URL in settings.py?

Upvotes: 0

Views: 109

Answers (1)

Higor Rossato
Higor Rossato

Reputation: 2046

You should have just the endpoint in this variable and Django will take care of the rest (base URL). This can be checked here

LOGIN_REDIRECT_URL = '/profile'

Upvotes: 2

Related Questions