Best way of linking to a page in Django

前端 未结 5 2172
臣服心动
臣服心动 2021-02-08 20:02

I managed to create a URL tag for my index. But right now I\'m confused how to add links to other pages.

I put this on my urls.py

url(r\         


        
5条回答
  •  臣服心动
    2021-02-08 20:57

    Example:

    urlpatterns = patterns('',
                           url(r'^$', views.index, name='index'),
                           url(r'^about/$', views.about', name='about'),
    )
    

    Now, in the html template rendered by your views.index you can have:

    about
    

提交回复
热议问题