django removing hardcoded URLs in template --- 使用变量,把url放在变量中 {% url 'namespace:name' %}
1urlpatterns=[2url(r'^admin/',admin.site.urls),3url(r'^votes/',include("polls.urls",namespace="polls")),4]/myproject/urls.py1#!/usr/bin/envpython2#-*-coding:utf-8-*-34'''5@version:6@author:leoYang7@li