LoginSignup
0
2

More than 5 years have passed since last update.

リクエストURLがないって言われる Udemy 【3日でできる】はじめての Django 入門 レクチャー33

Posted at

だいぶご無沙汰になってしまってるコレ()
今週中に攫おう。。。

はじめに

【3日でできる】はじめての Django 入門 ( Python 3 でウェブアプリを作って AWS EC2 で公開!)レクチャー33で「http://127.0.0.1:8000/posts/1」に飛ぼうとすると
『"GET /posts/1 HTTP/1.1" 404 2392』というエラーが出る。

結論

1系と2系の違いは辛い

エラーを吐く書き方

path('posts/(?P<post_id>[0-9]+)/$' , views.post_detail ,name = "post_detail")

動作する書き方

path('posts/<int:post_id>' , views.post_detail ,name = "post_detail")

書き方がシンプルになってていいね!

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2