Django can't find URL pattern

前端 未结 2 929
[愿得一人]
[愿得一人] 2020-12-20 23:53

I can\'t figure out why Django is unable to find the requested URL in my application.

Here is the error code I get:

 Using the URLconf defined in lit         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-21 00:51

    This problem is the dollar sign in this url pattern.

    url(r'^$', include('sms.urls')),
    

    The caret ^ matches the beginning of the string, and the dollar $ matches the end if the string, so ^$ only matches the index URL /.

    You should remove the dollar and change it to:

    url(r'^', include('sms.urls')),
    

提交回复
热议问题