Given a website, how would you get the HOST of that in a django template, without passing that var from the view?
http://google.com/hello --> {{ BASE_URL }} ==> 'http://google.com'
This has been answered extensively in the following post
There are several ways of doing it:
{{ request.get_host() }}
in your template **contrib.sites
framework** Please note these can be spoofed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With