Princess_Jasmine
Princess_Jasmine

Reputation: 61

how to get the absolute url of a view in django?

I have a view called "callback" in views.py. How can I get the absolute url with domain for that view?

I tried using:

request.build_absolute_url(reverse('authorize')) 

but that did not work.

What should I do?

Upvotes: 0

Views: 501

Answers (2)

jproffitt
jproffitt

Reputation: 6355

I believe it is build_absolute_uri not build_absolute_url

Upvotes: 2

thinker3
thinker3

Reputation: 13291

try this:

request.get_host() + reverse('authorize')

Upvotes: 0

Related Questions