django-获取当前url和ip

1.添加'django.template.context_processors.request',

 

2.在模板的html中输入

{{ request.path}}
{{ request.get_host}}

 


 3.结果

 

posted @ 2018-07-05 22:49  糖宝虫  阅读(2997)  评论(0)    收藏  举报