django-获取当前url和ip

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

 

2.在模板的html中输入

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

 


 3.结果

 

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