这些是我的文件:
网址.py:
from django.conf.urls import patterns, include, url
from eiris_wipro.views import *
urlpatterns = patterns('',
(r'^hello/$',hello),
(r'^articles/(?P<collection>)/$', restusers),
)
视图.py: 从django.http导入HttpResponse
def hello(request):
return HttpResponse("Hello new world!")
def restusers(request, collection='smthn'):
print 'Collection', collection
return HttpResponse(collection)
当我尝试按http://127.0.0.1:8000/articles/smthn/
时,我得到了404
错误!!你知道吗
我应该错过一些非常基本的东西。那会是什么?你知道吗
你还没有给这个模式任何东西去捕捉。应该是:
假设您想要捕获任意数量的字母数字字符。你知道吗
相关问题 更多 >
编程相关推荐