- 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
- Browser-native date input field by kytta 1 month, 1 week ago
- Generate and render HTML Table by LLyaudet 1 month, 2 weeks ago
- My firs Snippets by GutemaG 1 month, 2 weeks ago
- FileField having auto upload_to path by junaidmgithub 2 months, 3 weeks ago
- LazyPrimaryKeyRelatedField by LLyaudet 3 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.