如何在Django中构建我的url模式

时间:2015-06-16 19:21:30

标签: python django web django-views django-urls

  

http://localhost:8000/?Input=C%3A%5CUsers%5Crsukla%5CDesktop%5COHA_BPO_Project%5CClear+Capital%5CInput_CC1&Output=3A%5CUsers%5Crsukla%5CDesktop%5COHA_BPO_Project%5CClear+Capital%5CInput_CC1&id=CC1

我想构建我的网址模式,如果字符串以" id = CC1"结尾?那么它应该去bpo.views.cc1。我无法形成网址模式并需要帮助。以下是我的网址模式

urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'bpo.views.cc1', name='cc1'),
    url(r'^$', 'bpo.views.home', name='home'),  # ^$ is for ending the string
    # url(r'^blog/', include('blog.urls')),
    #url(r'home2$', 'bpo.views.home', name='home'),   for website ending with home2
    url(r'^admin/', include(admin.site.urls)),
)

0 个答案:

没有答案