- Author:
- limodou
- Posted:
- February 27, 2007
- Language:
- Python
- Version:
- Pre .96
- Score:
- 4 (after 6 ratings)
The result maybe:
http://localhost/test/
And for request.path, it will not include the domain field(http://localhost).
1 2 3 | def get_full_path(request):
full_path = ('http', ('', 's')[request.is_secure()], '://', request.META['HTTP_HOST'], request.path)
return ''.join(full_path)
|
More like this
- New Snippet! by Antoliny0919 4 days, 14 hours ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 2 months, 3 weeks ago
- get_object_or_none by azwdevops 6 months, 2 weeks ago
- Mask sensitive data from logger by agusmakmun 8 months, 1 week ago
- Template tag - list punctuation for a list of items by shapiromatron 1 year, 10 months ago
Comments
To be a bit more redundant, you could make that:
...or better:
#
Thanks. I lost secure.
#
You can use built-in function build_absolute_url()
#
Please login first before commenting.