{"id":2384,"date":"2021-10-23T07:22:19","date_gmt":"2021-10-22T22:22:19","guid":{"rendered":"https:\/\/nobunobu1717.site\/?p=2384"},"modified":"2022-10-02T09:00:18","modified_gmt":"2022-10-02T00:00:18","slug":"post-2384","status":"publish","type":"post","link":"https:\/\/nobunobu1717.site\/?p=2384","title":{"rendered":"\u3010\u6280\u8853\u66f8\u611f\u60f3\u3011\u5b9f\u8df5Django\u306f\u7d30\u304b\u3044\u90e8\u5206\u307e\u3067\u30ab\u30d0\u30fc\u3057\u305f\u5165\u9580\u66f8\u3002\u7d4c\u9a13\u8005\u304c\u8aad\u3093\u3067\u3082\u53c2\u8003\u306b\u306a\u308b"},"content":{"rendered":"<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> \u6982\u8981<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u66f8\u7c4d\u6982\u8981<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u5185\u5bb9\u306e\u307e\u3068\u3081\u3068\u611f\u60f3<\/a><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_1\">4<\/span> \u8aad\u66f8\u30ce\u30fc\u30c8(\u500b\u4eba\u7684\u306a\u307e\u3068\u3081)<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u6982\u8981<\/span><\/h2>\n<p>\u300c\u5b9f\u8df5Django Python\u306b\u3088\u308b\u672c\u683cWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u300d\u3092\u8aad\u3093\u3060\u306e\u3067\u611f\u60f3\u7b49\u3092\u66f8\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nDjango\u306b\u95a2\u3057\u3066\u306e\u5165\u9580\u66f8\u3067\u3059\u304c\u3001\u3051\u3063\u3053\u3046\u7d30\u304b\u3044\u90e8\u5206\u3084\u6df1\u3044\u90e8\u5206\u307e\u3067\u89e3\u8aac\u3055\u308c\u3066\u3044\u3066\u3001\u5165\u9580\u304c\u7d42\u308f\u3063\u305fDjango\u7d4c\u9a13\u8005\u304c\u8aad\u3080\u3068\u53c2\u8003\u306b\u306a\u308a\u305d\u3046\u306a\u66f8\u7c4d\u3067\u3059\u3002<\/p>\n<div class=\"kattene\">\n    <div class=\"kattene__imgpart\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\"><img width=\"160\" height=\"160\" loading=\"lazy\" src=\"https:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;MarketPlace=JP&amp;ASIN=B095BZPJYW&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL250_&amp;tag=nobu17171009-22\" class=\"kattene__shadow\" ><\/a><\/div>\n    <div class=\"kattene__infopart\">\n      <div class=\"kattene__title\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\">\u5b9f\u8df5Django<\/a><\/div>\n      <div class=\"kattene__description\">\u73fe\u5834\u3067\u5f79\u7acb\u3064\u5b9f\u8df5\u7684\u306a\u30ce\u30a6\u30cf\u30a6\u3092\u5fb9\u5e95\u89e3\u8aac<\/div>\n      <div class=\"kattene__btns __one\"><div><a class=\"kattene__btn __orange\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\">Amazon<\/a><\/div><\/div><\/div><\/div>\n<p>&nbsp;<\/p>\n<p>\u6280\u8853\u66f8\u306e\u30bb\u30fc\u30eb\u3068\u304a\u3059\u3059\u3081\u66f8\u7c4d\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002\u5408\u308f\u305b\u3066\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"3e73Iy5ss7\"><p><a href=\"https:\/\/nobunobu1717.site\/?p=2713\">\u301010\/13\u307e\u3067\u3011Amazon Kindle\u3067\u6280\u8853\u66f8\u304c\u534a\u984d\u30bb\u30fc\u30eb\u4e2d\u3002\u73fe\u5f79\u30a8\u30f3\u30b8\u30cb\u30a2\u304b\u3089\u898b\u305f\u30aa\u30b9\u30b9\u30e1\u66f8\u7c4d\u3082\u7d39\u4ecb<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u301010\/13\u307e\u3067\u3011Amazon Kindle\u3067\u6280\u8853\u66f8\u304c\u534a\u984d\u30bb\u30fc\u30eb\u4e2d\u3002\u73fe\u5f79\u30a8\u30f3\u30b8\u30cb\u30a2\u304b\u3089\u898b\u305f\u30aa\u30b9\u30b9\u30e1\u66f8\u7c4d\u3082\u7d39\u4ecb&#8221; &#8212; nobu blog\" src=\"https:\/\/nobunobu1717.site\/?p=2713&#038;embed=true#?secret=QBsdxJqlTN#?secret=3e73Iy5ss7\" data-secret=\"3e73Iy5ss7\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-2\">\u66f8\u7c4d\u6982\u8981<\/span><\/h2>\n<h3>\u3069\u3093\u306a\u672c\uff1f<\/h3>\n<blockquote><p>\u73fe\u5834\u3067\u5f79\u7acb\u3064\u5b9f\u8df5\u7684\u306a\u30ce\u30a6\u30cf\u30a6\u3092\u5fb9\u5e95\u89e3\u8aac<\/p>\n<p>\u3010Django\u3068\u306f\u3011<br \/>\nDjango\u306f\u3001Python\u3067\u4eba\u6c17\u306e\u3042\u308b\u30d5\u30eb\u30b9\u30bf\u30c3\u30afWeb\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<br \/>\n\u5f37\u529b\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3084O\/R\u30de\u30c3\u30d1\u30fc\u306b\u52a0\u3048\u3001\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u3084\u56fd\u969b\u5316\u3001\u7ba1\u7406\u753b\u9762\u306a\u3069\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u5fc5\u8981\u306b\u306a\u308b\u3042\u308a\u3068\u3042\u3089\u3086\u308b\u6a5f\u80fd\u3092\u9ad8\u3044\u67d4\u8edf\u6027\u3067\u63d0\u4f9b\u3057\u3001\u9ad8\u901f\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3010\u672c\u66f8\u306e\u30dd\u30a4\u30f3\u30c8\u3011<br \/>\n\u672c\u66f8\u306f\u3001\u696d\u52d9\u3067\u5fc5\u305a\u5f79\u306b\u7acb\u3064\u5b9f\u8df5\u7684\u306aDjango\u306e\u89e3\u8aac\u66f8\u3067\u3059\u3002\u30e2\u30c7\u30eb\u3084\u30d3\u30e5\u30fc\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3044\u3063\u305f\u57fa\u672c\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u89e3\u8aac\u306f\u3082\u3061\u308d\u3093\u3001Django\u306e\u5b9f\u8df5\u7684\u306a\u30c6\u30b9\u30c8\u30c6\u30af\u30cb\u30c3\u30af\u3001\u30e6\u30fc\u30b6\u30fc\u30e2\u30c7\u30eb\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u65b9\u6cd5\u3001\u8a8d\u8a3c\u51e6\u7406\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306a\u3069\u3001Web\u958b\u767a\u306b\u304a\u3044\u3066\u5fc5\u305a\u77e5\u3063\u3066\u304a\u304f\u3079\u304d\u5185\u5bb9\u3092\u5e45\u5e83\u304f\u53d6\u308a\u4e0a\u3052\u307e\u3057\u305f\u3002<br \/>\n\u307e\u305f\u5b9f\u969b\u306b\u696d\u52d9\u3067Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u53d6\u308a\u7d44\u3080\u969b\u306b\u306f\u3001\u3053\u308c\u3089\u306e\u7406\u89e3\u3060\u3051\u3067\u306f\u4e0d\u5341\u5206\u306a\u3053\u3068\u3082\u3057\u3070\u3057\u3070\u3042\u308a\u307e\u3059\u3002<br \/>\nN+1\u554f\u984c\u306e\u7406\u89e3\u3084\u5bfe\u7b56\u65b9\u6cd5\u3001RDB\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306b\u3088\u308bSQL\u306e\u6700\u9069\u5316\u3001Web API\u306e\u5b9f\u8df5\u7684\u306a\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u88c5\u65b9\u6cd5\u3001CSRF\u3084SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306e\u3088\u3046\u306a\u653b\u6483\u3092\u9632\u3050\u305f\u3081\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u95a2\u3059\u308b\u77e5\u8b58\u306a\u3069\u3001\u9ad8\u5ea6\u304b\u3064\u91cd\u8981\u306a\u30c8\u30d4\u30c3\u30af\u3092Django\u306e\u30b3\u30f3\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u7d4c\u9a13\u3082\u3042\u308b\u7b46\u8005\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u3010\u672c\u66f8\u306e\u30b4\u30fc\u30eb\u3011<br \/>\nDjango\u3092\u4f7f\u3063\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u628a\u63e1\u3057\u3001\u696d\u52d9\u306b\u6d3b\u304b\u305b\u308b\u5b9f\u8df5\u7684\u306a\u77e5\u8b58\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3092\u76ee\u6307\u3057\u307e\u3059\u3002<\/p><\/blockquote>\n<ul class=\"biblio\">\n<li>\u829d\u7530 \u5c06 \u8457<\/li>\n<li>2021\u5e7407\u670819\u65e5 \u767a\u884c<\/li>\n<li>312\u30da\u30fc\u30b8<\/li>\n<li>\u5b9a\u4fa13,850\u5186(\u7a0e\u8fbc)<\/li>\n<\/ul>\n\n\t<p style=\"color:#666;margin-bottom:5px;\">\u30b9\u30dd\u30f3\u30b5\u30fc\u30ea\u30f3\u30af<\/p>\n\t<div class=\"middle-ad\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\n\n<h2><span id=\"i-3\">\u5185\u5bb9\u306e\u307e\u3068\u3081\u3068\u611f\u60f3<\/span><\/h2>\n<p>Python\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b\u3001Django\u306e\u89e3\u8aac\u66f8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5165\u9580\u66f8\u3068\u3044\u3046\u7acb\u3061\u4f4d\u7f6e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u30bf\u30a4\u30c8\u30eb\u306b\u5b9f\u8df5\u3068\u4ed8\u3044\u3066\u3044\u308b\u3060\u3051\u3042\u3063\u3066\u3001\u30ec\u30d9\u30eb\u306f\u9ad8\u3081\u3002<br \/>\nPython\u672a\u7d4c\u9a13\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u672a\u7d4c\u9a13\u8005\u304c\u3044\u304d\u306a\u308a\u672c\u66f8\u3092\u8aad\u3080\u3068\u304a\u305d\u3089\u304f\u30ad\u30c4\u30a4\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4e0a\u8a18\u3092\u6e80\u305f\u3057\u3066\u3044\u3066\u3082Django\u3092\u3053\u308c\u304b\u3089\u5b66\u307c\u3046\u3068\u601d\u3063\u3066\u3044\u308b\u4eba\u3088\u308a\u304b\u306f\u3001\u5165\u9580\u66f8\u7b49\u3067\u4e00\u901a\u308a\u306e\u57fa\u672c\u306f\u5b66\u3093\u3060\u4eba\u306e\u65b9\u304c\u672c\u66f8\u306b\u306f\u5411\u3044\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u5165\u9580\u7684\u306a\u5185\u5bb9\u306f\u30b5\u30af\u30c3\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u3066\u3001\u4ee3\u308f\u308a\u306b\u500b\u3005\u306e\u6a5f\u80fd\u306e\u7d30\u304b\u3044\u90e8\u5206\u306b\u95a2\u3057\u3066\u8aac\u660e\u3092\u591a\u304f\u5272\u3044\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002(\u4f8b\u3048\u3070\u3001Django ORM\u306e\u30d9\u30fc\u30b7\u30c3\u30af\u306a\u6a5f\u80fd\u306f\u30b5\u30af\u30c3\u3068\u8aac\u660e\u3057\u3066\u3001\u4ee3\u308f\u308a\u306bn+1\u554f\u984c\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3001\u30af\u30a8\u30ea\u306e\u89e3\u6790\u3068\u9ad8\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5316\u306a\u3069\u306b\u8aac\u660e\u3092\u5272\u3044\u3066\u3044\u307e\u3059\u3002)<\/p>\n<p>\u3067\u3059\u306e\u3067\u3001Django\u3092\u5b66\u3073\u305f\u3044\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u5165\u9580\u66f8\u306e\u6b21\u306e2\u518a\u76ee\u306b\u8aad\u3080\u306e\u306b\u6700\u9069\u306a\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f\u3001\u4e0b\u8a18\u306e\u300cDjango\u306e\u30c4\u30dc\u3068\u30b3\u30c4\u304c\u30bc\u30c3\u30bf\u30a4\u306b\u308f\u304b\u308b\u672c\u300d\u3092\u6700\u521d\u306b\u8aad\u3093\u3067\u3001Web\u30b5\u30a4\u30c8\u3092\u5b9f\u969b\u306b\u69cb\u7bc9\u3057\u306a\u304c\u3089\u3001\u4e00\u901a\u308a\u306e\u4f5c\u308a\u65b9\u3092\u5b66\u3093\u3060\u5f8c\u306b\u672c\u66f8\u3092\u8aad\u3093\u3060\u72b6\u614b\u3067\u3059\u3002\u5165\u9580\u66f8\u3068\u3057\u3066\u306f\u304b\u306a\u308a\u6577\u5c45\u304c\u4f4e\u3044\u306e\u3067\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n<div class=\"kattene\">\n    <div class=\"kattene__imgpart\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\"><img width=\"160\" height=\"160\" loading=\"lazy\" src=\"https:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;MarketPlace=JP&amp;ASIN=B08KHDJDHQ&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL250_&amp;tag=nobu17171009-22\" class=\"kattene__shadow\" ><\/a><\/div>\n    <div class=\"kattene__infopart\">\n      <div class=\"kattene__title\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\">Django\u306e\u30c4\u30dc\u3068\u30b3\u30c4\u304c\u30bc\u30c3\u30bf\u30a4\u306b\u308f\u304b\u308b\u672c<\/a><\/div>\n      <div class=\"kattene__description\">\u300cDjango\u306b\u8208\u5473\u304c\u3042\u308b\u3051\u3069\u3001\u4f55\u304b\u3089\u624b\u3092\u4ed8\u3051\u308c\u3070\u826f\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u300d\u300c\u4e00\u5ea6\u3001Django\u306e\u5b66\u7fd2\u306b\u632b\u6298\u3057\u3066\u3057\u307e\u3063\u305f\u3051\u308c\u3069\u3001\u3084\u3063\u3071\u308a\u7406\u89e3\u3057\u305f\u3044\u300d\u305d\u3093\u306a\u65b9\u306b\u304a\u3059\u3059\u3081\u3057\u307e\u3059\uff01<\/div>\n      <div class=\"kattene__btns __one\"><div><a class=\"kattene__btn __orange\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\">Amazon<\/a><\/div><\/div><\/div><\/div>\n<p>&nbsp;<\/p>\n<h3>\u826f\u304b\u3063\u305f\u70b9<\/h3>\n<p>\u524d\u8ff0\u306e\u901a\u308a\u3001\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u3001\u3088\u308a\u6df1\u3044\u90e8\u5206\u306b\u8aac\u660e\u3092\u3057\u3063\u304b\u308a\u3068\u5272\u3044\u3066\u3044\u308b\u70b9\u3067\u3059\u3002<\/p>\n<p>\u3068\u308a\u3048\u3042\u305a\u52d5\u304f\u3067\u306f\u306a\u304f\u3001\u5b9f\u8df5\u30ec\u30d9\u30eb\u3067\u52d5\u304b\u3059\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u767b\u9332\u3059\u308b\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3092\u30c6\u30fc\u30de\u3068\u3057\u3066\u3001\u5b9f\u88c5\u3092\u884c\u3044\u306a\u304c\u3089\u8aac\u660e\u3057\u3066\u3044\u304f\u306e\u3067\u3059\u304c\u3001\u524d\u534a\u306f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u7684\u306a\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5148\u306b\u66f8\u304d\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304f\u3068\u3044\u3046\u70b9\u3082\u9762\u767d\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u6c17\u306b\u306a\u3063\u305f\u70b9<\/h3>\n<p>\u5165\u9580\u7684\u306a\u5185\u5bb9\u304c\u30b5\u30af\u30c3\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u524d\u8ff0\u306e\u901a\u308a\u3067\u3059\u304c\u3001\u30b3\u30fc\u30c9\u542b\u3081\u3066\u8aac\u660e\u304c\u304b\u306a\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u7d30\u304b\u3044\u3068\u3053\u308d\u3092\u8aac\u660e\u3057\u306a\u3044\u70b9\u304c\u591a\u3044\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u898b\u305f\u3053\u3068\u306e\u306a\u3044\u30e1\u30bd\u30c3\u30c9\u3084\u95a2\u6570\u304c\u30b5\u30e9\u30c3\u3068\u4f7f\u308f\u308c\u3066\u3044\u305f\u308a\u3059\u308b\u306e\u3067\u3001\u81ea\u5206\u3067\u3057\u3063\u304b\u308a\u3068\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3060\u308a\u3001\u5225\u9014\u30b0\u30b0\u3063\u305f\u308a\u3057\u306a\u3044\u3068\u308f\u304b\u3089\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u70b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001Django\u306eView\u306b\u95a2\u3057\u3066\u306f\u3001\u95a2\u6570\u30d9\u30fc\u30b9\u3084\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306e\u8a18\u8ff0\u304c\u6df7\u5728\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3067\u304d\u308c\u3070\u6700\u521d\u306e\u65b9\u3067\u4e21\u65b9\u8aac\u660e\u3057\u305f\u4e0a\u3067\u3001\u9014\u4e2d\u304b\u3089\u3069\u3061\u3089\u304b\u306b\u7d71\u4e00\u3057\u3066\u304a\u3044\u305f\u65b9\u304c\u826f\u304b\u3063\u305f\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>(\u95a2\u6570\u30d9\u30fc\u30b9\u306e\u65b9\u304c\u5165\u9580\u7684\u306b\u306f\u308f\u304b\u308a\u3084\u3059\u3044\u304c\u3001\u500b\u4eba\u7684\u306b\u306f\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u304c\u597d\u304d\uff09<\/p>\n<p>&nbsp;<\/p>\n<div class=\"kattene\">\n    <div class=\"kattene__imgpart\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\"><img width=\"160\" height=\"160\" loading=\"lazy\" src=\"https:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;MarketPlace=JP&amp;ASIN=B095BZPJYW&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL250_&amp;tag=nobu17171009-22\" class=\"kattene__shadow\" ><\/a><\/div>\n    <div class=\"kattene__infopart\">\n      <div class=\"kattene__title\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\">\u5b9f\u8df5Django<\/a><\/div>\n      <div class=\"kattene__description\">\u73fe\u5834\u3067\u5f79\u7acb\u3064\u5b9f\u8df5\u7684\u306a\u30ce\u30a6\u30cf\u30a6\u3092\u5fb9\u5e95\u89e3\u8aac<\/div>\n      <div class=\"kattene__btns __one\"><div><a class=\"kattene__btn __orange\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B095BZPJYW\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B095BZPJYW&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=e75e1c02b4883a936db2fe826841b4a4\">Amazon<\/a><\/div><\/div><\/div><\/div>\n<div class=\"kattene\">\n    <div class=\"kattene__imgpart\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\"><img width=\"160\" height=\"160\" loading=\"lazy\" src=\"https:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;MarketPlace=JP&amp;ASIN=B08KHDJDHQ&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL250_&amp;tag=nobu17171009-22\" class=\"kattene__shadow\" ><\/a><\/div>\n    <div class=\"kattene__infopart\">\n      <div class=\"kattene__title\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\">Django\u306e\u30c4\u30dc\u3068\u30b3\u30c4\u304c\u30bc\u30c3\u30bf\u30a4\u306b\u308f\u304b\u308b\u672c<\/a><\/div>\n      <div class=\"kattene__description\">\u300cDjango\u306b\u8208\u5473\u304c\u3042\u308b\u3051\u3069\u3001\u4f55\u304b\u3089\u624b\u3092\u4ed8\u3051\u308c\u3070\u826f\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u300d\u300c\u4e00\u5ea6\u3001Django\u306e\u5b66\u7fd2\u306b\u632b\u6298\u3057\u3066\u3057\u307e\u3063\u305f\u3051\u308c\u3069\u3001\u3084\u3063\u3071\u308a\u7406\u89e3\u3057\u305f\u3044\u300d\u305d\u3093\u306a\u65b9\u306b\u304a\u3059\u3059\u3081\u3057\u307e\u3059\uff01<\/div>\n      <div class=\"kattene__btns __one\"><div><a class=\"kattene__btn __orange\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.amazon.co.jp\/gp\/offer-listing\/B08KHDJDHQ\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B08KHDJDHQ&amp;linkCode=am2&amp;tag=nobu17171009-22&amp;linkId=ae7ee1d2dcd79f78de15eeaa73ccc17a\">Amazon<\/a><\/div><\/div><\/div><\/div>\n\n\t<p style=\"color:#666;margin-bottom:5px;\">\u30b9\u30dd\u30f3\u30b5\u30fc\u30ea\u30f3\u30af<\/p>\n\t<div class=\"middle-ad\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\n\n<h2><span id=\"i-4\">\u8aad\u66f8\u30ce\u30fc\u30c8(\u500b\u4eba\u7684\u306a\u307e\u3068\u3081)<\/span><\/h2>\n<h3>\u7b2c1\u90e8 \u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u5171\u6709\u30b5\u30a4\u30c8\u306e\u958b\u767a<\/h3>\n<p>\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u767b\u9332\u3001\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306aWeb\u30b5\u30a4\u30c8\u3092\u5b9f\u969b\u306b\u4f5c\u308a\u306a\u304c\u3089\u3001Django\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u3092\u5b66\u3093\u3067\u3044\u304f\u7ae0\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>DB\u3092\u4f7f\u3063\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3084ORM\u3001\u30d3\u30e5\u30fc\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306a\u3069\u5165\u9580\u66f8\u304c\u3058\u3063\u304f\u308a\u3068\u9806\u3005\u306b\u8aac\u660e\u3059\u308b\u90e8\u5206\u3092\u5168\u3066\u30b5\u30e9\u30c3\u3068\u8aac\u660e\u3059\u308b\u306e\u3067\u3001Django\u521d\u4f53\u9a13\u3060\u3068\u8ffd\u3044\u3064\u304f\u306e\u304c\u5927\u5909\u304b\u3082\u3002<\/p>\n<p>\u6700\u521d\u304b\u3089\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3092\u4f5c\u308a\u306a\u304c\u3089\u306e\u3001\u30c6\u30b9\u30c8\u99c6\u52d5\u7684\u306a\u958b\u767a\u65b9\u6cd5\u306b\u306a\u308b\u306e\u3082\u9762\u767d\u3044\u3067\u3059\u304c\u3001\u521d\u5fc3\u8005\u306b\u306f\u30ad\u30c4\u30a4\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>get_object_or_404<\/h4>\n<p>\u30e2\u30c7\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u6642\u306b\u4e00\u81f4\u6761\u4ef6\u3067\u30c7\u30fc\u30bf\u304c\u306a\u3044\u5834\u5408\u306b\u81ea\u52d5\u3067404\u3092\u6295\u3052\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\u30c7\u30fc\u306e\u53d6\u5f97\u7d50\u679c\u306b\u5fdc\u3058\u3066\u51e6\u7406\u3092\u5206\u3051\u3066\u5b9f\u88c5\u3057\u306a\u304f\u3066\u826f\u3044\u306e\u3067\u697d\u3002<\/p>\n<pre class=\"lang:default decode:true\">## Snippet\u30e2\u30c7\u30eb\u306b\u5bfe\u3057\u3066pk\u304c1\u3067namae\u304caaaa\u306e\u3082\u306e\u304c\u7121\u3044\u304b\u3092DB\u306b\u554f\u3044\u5408\u308f\u305b\u308b\r\n## \u5b58\u5728\u3057\u306a\u3051\u308c\u3070404\u30da\u30fc\u30b8\u3092\u8868\u793a\u3057\u3066\u304f\u308c\u308b\r\nsnippet = get_list_or_404(Snippet, pk=1, name='aaaa')<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u7b2c2\u90e8 \u30e2\u30c7\u30eb\u5b9a\u7fa9\u3068\u30af\u30a8\u30ea\u64cd\u4f5c<\/h3>\n<p>Django ORM\u3092\u4f7f\u7528\u3057\u305f\u30e2\u30c7\u30eb\u3084\u30af\u30a8\u30ea\u64cd\u4f5c\u306b\u95a2\u3057\u3066\u6df1\u5800\u3057\u3066\u3044\u304f\u7ae0\u3067\u3059\u3002<\/p>\n<p>N+1\u554f\u984c\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3001\u30af\u30a8\u30ea\u306e\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u7b49\u3001\u5165\u9580\u66f8\u3067\u306f\u89e6\u308c\u306a\u3044\u3082\u3057\u304f\u306f\u6700\u5f8c\u306e\u65b9\u3067\u8efd\u304f\u8aac\u660e\u3055\u308c\u308b\u5185\u5bb9\u304c\u3057\u3063\u304b\u308a\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u30e2\u30c7\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u3068QuerySet<\/h4>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u3067\u983b\u7e41\u306b\u4f7f\u7528\u3055\u308c\u308b\u30af\u30a8\u30ea\u64cd\u4f5c\u306f\u30e2\u30c7\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u3084QuerySet\u306b\u307e\u3068\u3081\u308b\u306e\u304c\u826f\u3044\u3002<\/p>\n<p>\u30e2\u30c7\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u306e\u4f8b<\/p>\n<pre class=\"lang:default decode:true \">class DraftSnippetManager(models.Manager):\r\n    def get_queryset(self):\r\n        return super().get_queryset().filter(is_draft=True)\r\n \r\nclass Snippet(models.Model):\r\n    ...\r\n    is_draft = models.BoolenaFiled(_('Draft'), default=True)\r\n\r\n    objects = models.models.Manager()\r\n    ## \u5b9a\u7fa9\u3057\u305f\u30de\u30cd\u30fc\u30b8\u30e3\u3092\u4f7f\u7528\r\n    drafts = DraftSnippetManager()\r\n\r\n\r\n### \u4f7f\u7528\u4f8b\r\nSnippet.drafts.all()<\/pre>\n<p>&nbsp;<\/p>\n<p>\u30af\u30a8\u30ea\u30bb\u30c3\u30c8\u306e\u4f8b\u3002objects\u306b\u30af\u30a8\u30ea\u30bb\u30c3\u30c8\u306eas_manager\u30e1\u30bd\u30c3\u30c9\u3092\u8aad\u3093\u3067\u30de\u30cd\u30fc\u30b8\u30e3\u3068\u3057\u3066\u30bb\u30c3\u30c8\u3059\u308b\u3002<\/p>\n<p>\u30af\u30a8\u30ea\u30bb\u30c3\u30c8\u306e\u65b9\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u540c\u6642\u547c\u3073\u51fa\u3057\u306a\u3069\u3082\u53ef\u80fd\u3002<\/p>\n<pre class=\"lang:default decode:true \">class SnippetQuerySet(models.QuerySet):\r\n    def drafts(self):\r\n        return self.filter(is_draft=True)\r\n\r\n    def recent_updates(self):\r\n        return self.order_by(\"-updated_ad\")\r\n \r\nclass Snippet(models.Model):\r\n    ...\r\n    is_draft = models.BoolenaFiled(_('Draft'), default=True)\r\n    ## \u5b9a\u7fa9\u3057\u305f\u30af\u30a8\u30ea\u30bb\u30c3\u30c8\u306e\u30de\u30cd\u30fc\u30b8\u30e3\u3092\u6307\u5b9a\r\n    objects = SnippetQuerySet.as_manager()\r\n\r\n\r\n\r\n### \u4f7f\u7528\u4f8b\u3000\u30e1\u30bd\u30c3\u30c9\u306e\u30c1\u30a7\u30fc\u30f3\u304c\u53ef\u80fd\r\nSnippet.objects.drafts().recent_updates()<\/pre>\n<p>&nbsp;<\/p>\n<p>\u672c\u66f8\u3060\u3051\u3060\u3068\u3055\u3063\u304f\u308a\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u4e0b\u8a18\u304c\u7d30\u304b\u304f\u8aac\u660e\u3055\u308c\u3066\u3044\u3066\u53c2\u8003\u306b\u306a\u3063\u305f\u3002<\/p>\n<p>https:\/\/selfs-ryo.com\/detail\/model_methods<\/p>\n<p>&nbsp;<\/p>\n<h4>\u660e\u793a\u7684\u306a\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u7ba1\u7406<\/h4>\n<p>transaction.atomic\u3067\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b9\u30b3\u30fc\u30d7\u3092\u6307\u5b9a\u3057\u3066\u3001\u30e2\u30c7\u30eb\u306e\u64cd\u4f5c\u3092\u884c\u3046\u4e8b\u3067\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u304b\u3051\u3089\u308c\u308b\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u66f4\u65b0\u3067\u3042\u308c\u3070\u3001select_for_update\u3067\u884c\u30ed\u30c3\u30af\u3092\u304b\u3051\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u66f4\u65b0\u3092\u304b\u3051\u308b<\/p>\n<pre class=\"lang:default decode:true\">def hoge_view(request):\r\n    ...\r\n    with transaction.atomic():\r\n        ## select_for_update\u3067\u5bfe\u8c61\u306e\u884c\u306b\u5bfe\u3057\u3066\u30ed\u30c3\u30af\u3092\u304b\u3051\u308b\r\n        products = Product.objects.select_for_update().get(id=1)\r\n        product.inventory -= 1\r\n        product.save()\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4>\u30c6\u30fc\u30d6\u30eb\u7d50\u5408<\/h4>\n<ul>\n<li>1:1\u306e\u95a2\u4fc2\u306e\u5834\u5408(ForeignKey\u3084OneToOneField)\n<ul>\n<li>select_related\u3092\u4f7f\u7528\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<li>\u4e0a\u8a18\u4ee5\u5916\u306e\u591a\u6570\u306e\u95a2\u4fc2(n:n\u306a\u3069)\n<ul>\n<li>prefetch_related\u3092\u4f7f\u7528\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u7b2c3\u90e8 \u30d3\u30e5\u30fc<\/h3>\n<p>\u30d3\u30e5\u30fc\u306e\u8aac\u660e\u3092\u884c\u3063\u3066\u3044\u308b\u7ae0\u3067\u3059\u3002<\/p>\n<p>Django\u306e\u5834\u5408\u3001MVC\u3067\u3044\u3046\u3068\u3053\u308d C(\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9)\u304c\u30d3\u30e5\u30fc\u3068\u547c\u3070\u308c\u308b\u306e\u3067\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u3059\u304c\u3001HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3084\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u3044\u3063\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u7684\u306a\u5f79\u5272\u306e\u6a5f\u80fd\u306e\u8aac\u660e\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3084\u3063\u3068\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306e\u30d3\u30e5\u30fc\u306b\u95a2\u3057\u3066\u8aac\u660e\u304c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u306b\u3082\u30c7\u30b3\u30ec\u30fc\u30bf\u30fc\u3084\u30df\u30c3\u30af\u30b9\u30a4\u30f3\u3001\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u4f7f\u7528\u3057\u305f\u518d\u5229\u7528\u6027\u306e\u5411\u4e0a\u306b\u95a2\u3057\u3066\u3082\u89e6\u308c\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u304b\u306a\u308a\u30b5\u30e9\u30c3\u3068\u89e6\u308c\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3053\u3053\u3092\u3082\u3046\u5c11\u3057\u6df1\u6398\u308a\u3057\u3066\u8aac\u660e\u3057\u3066\u6b32\u3057\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<h3>\u7b2c4\u90e8 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3<\/h3>\n<p>MVC\u3067\u3044\u3046\u3068\u3053\u308d\u306eV(\u30d3\u30e5\u30fc)\u306b\u3042\u305f\u308b\u3001\u753b\u9762\u5468\u308a\u306e\u8aac\u660e\u3067\u3059\u3002<\/p>\n<p>Django\u3067\u3082HTML\u30d9\u30fc\u30b9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306f\u3001\u4e00\u822c\u7684\u306aWeb\u30a2\u30d7\u30ea\u3068\u4f3c\u3066\u3044\u308b\u306e\u3067\u7d4c\u9a13\u8005\u3067\u3042\u308c\u3070\u30b5\u30af\u30c3\u3068\u8aad\u3081\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u7d99\u627f\u3001\u57cb\u3081\u8fbc\u307f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a3\u30eb\u30bf\u7b49\u3005\u3001\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u7b2c5\u90e8 \u30d5\u30a9\u30fc\u30e0<\/h3>\n<p>\u30d5\u30a9\u30fc\u30e0\u753b\u9762\u306a\u3069\u306b\u304a\u3044\u3066\u3001\u5fc5\u8981\u3068\u306a\u308b\u30d5\u30a9\u30fc\u30e0\u306b\u95a2\u3057\u3066\u8aac\u660e\u3059\u308b\u7ae0\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306bModelForms\u3092\u4e2d\u5fc3\u3068\u3057\u305f\u8aac\u660e\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u57fa\u672c\u7684\u306a\u8aac\u660e\u304c\u4e2d\u5fc3\u3067\u3059\u3002<\/p>\n<p>\u524d\u7ae0\u3067\u306fXSS\u306e\u8aac\u660e\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u3053\u3061\u3089\u3067\u306fCSRF\u306e\u8aac\u660e\u304c\u3042\u3063\u305f\u308a\u3068\u30bb\u30ad\u30e5\u30a2\u306a\u5b9f\u88c5\u306b\u95a2\u3057\u3066\u3082\u30b1\u30a2\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u7b2c6\u90e8 \u30c6\u30b9\u30c8<\/h3>\n<p>Django\u3067\u306f\u6700\u521d\u304b\u3089\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u304c\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u308c\u3089\u3092\u4f7f\u3063\u305f\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306b\u95a2\u3057\u3066\u8aac\u660e\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306fCD\/CI\u3001BDD\u3001Selenium\u306a\u3069\u5e45\u5e83\u304f\u53d6\u308a\u4e0a\u3052\u3059\u304e\u3066\u5168\u4f53\u7684\u306b\u8584\u3044\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u308b\u611f\u3058\u304c\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>1\u7ae0\u3067\u305b\u3063\u304b\u304fTDD\u3067\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u4f7f\u3063\u3066\u3044\u305f\u306e\u3060\u304b\u3089\u3001\u500b\u3005\u306e\u5c64\u306b\u5bfe\u3057\u3066\u3053\u3046\u3044\u3063\u305f\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u3068\u3044\u3063\u305f\u5185\u5bb9\u3092\u3053\u3053\u3067\u307e\u3068\u3081\u3066\u304f\u308c\u305f\u65b9\u304c\u826f\u304b\u3063\u305f\u3068\u500b\u4eba\u7684\u306b\u306f\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u306e\u8a71\u3082\u51fa\u3066\u304d\u307e\u3059\u304c\u3001\u7d39\u4ecb\u30ec\u30d9\u30eb\u3068\u3044\u3063\u305f\u611f\u3058\u306a\u306e\u3068\u3001DB\u306b\u95a2\u3057\u3066\u306f\u5b9f\u969b\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30c6\u30b9\u30c8\u3059\u308b\u65b9\u6cd5\u304c\u30e1\u30a4\u30f3\uff08\u7d71\u5408\u30c6\u30b9\u30c8\uff09\u3067\u3001\u3082\u3046\u5c11\u3057\u3053\u306e\u7ae0\u306f\u4e0d\u8981\u306a\u3082\u306e\u306f\u524a\u304e\u843d\u3068\u3057\u3066\u500b\u3005\u306e\u5185\u5bb9\u3092\u5145\u5b9f\u3055\u305b\u3066\u6b32\u3057\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u7b2c7\u90e8 \u8a8d\u8a3c \u8a8d\u53ef<\/h3>\n<p>1\u7ae0\u3067\u3055\u304f\u3063\u3068\u30ed\u30b0\u30a4\u30f3\u3068\u30ed\u30b0\u30a2\u30a6\u30c8\u306a\u3069\u306e\u8a8d\u8a3c\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u672c\u7ae0\u3067\u306f\u305d\u308c\u4ee5\u5916\u306e\u6a5f\u80fd\u3082\u542b\u3081\u3066\u8a8d\u8a3c\u3068\u8a8d\u53ef\u306b\u95a2\u3057\u3066\u307e\u3068\u3081\u3066\u3044\u308b\u7ae0\u3067\u3059\u3002<\/p>\n<p>\u5165\u9580\u66f8\u3060\u3068\u3053\u306e\u3042\u305f\u308a\u306fall_auth\u3042\u305f\u308a\u3092\u4f7f\u3063\u3066\u3088\u304f\u308f\u304b\u3089\u305a\u5b9f\u88c5\u3057\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u304c\u3001\u672c\u66f8\u3067\u306f\u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8\u3060\u3051\u3067\u4e00\u901a\u308a\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u306e\u3067\u3001\u4ed5\u7d44\u307f\u3092\u5b66\u3076\u306b\u306f\u826f\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u7b2c8\u90e8 Web API\u958b\u767a<\/h3>\n<p>Django REST Framework\u3092\u4f7f\u7528\u3057\u305fWeb API\u306e\u5b9f\u88c5\u306b\u95a2\u3057\u3066\u8aac\u660e\u3057\u3066\u3044\u308b\u7ae0\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306bDjango\u672c\u4f53\u306b\u4f3c\u305f\u69cb\u9020\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u4f7f\u7528\u3059\u308b\u30af\u30e9\u30b9\u306a\u3069\u304c\u5fae\u5999\u306b\u9055\u3046\u306e\u3068\u3001\u4f7f\u3063\u305f\u4e8b\u304c\u7121\u304b\u3063\u305f\u306e\u3067\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3084JWT\u3068\u3044\u3063\u305f\u5165\u9580\u66f8\u3067\u306f\u3042\u307e\u308a\u3084\u3089\u306a\u3044\u3088\u3046\u306a\u30b9\u30b3\u30fc\u30d7\u307e\u3067\u542b\u3093\u3067\u3044\u308b\u306e\u3082\u9762\u767d\u3044\u3067\u3059\u3002<\/p>\n<p>\u672c\u66f8\u306b\u3082\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001WebAPI\u81ea\u4f53\u306e\u8a2d\u8a08\u306f\u30aa\u30e9\u30a4\u30ea\u30fc\u306e\u30d8\u30d3\u672c(Web API The Good Parts)\u304c\u975e\u5e38\u306b\u53c2\u8003\u306b\u306a\u308b\u306e\u3067\u5408\u308f\u305b\u3066\u8aad\u3093\u3060\u65b9\u304c\u826f\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u7b2c9\u90e8 \u30b1\u30fc\u30b9\u5225\u30ec\u30b7\u30d4\u96c6<\/h3>\n<p>\u3053\u308c\u307e\u3067\u306e\u7ae0\u306b\u306f\u5165\u3063\u3066\u3044\u306a\u3044\u304c\u3001\u77e5\u3063\u3066\u304a\u304f\u3068\u826f\u3044\u6a5f\u80fd\u3092\u307e\u3068\u3081\u3066\u3044\u308b\u7ae0\u3067\u3059\u3002<\/p>\n<p>\u56fd\u969b\u5316(\u591a\u8a00\u8a9e\u5316)\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306a\u3069\u3088\u304f\u4f7f\u308f\u308c\u308b\u30b1\u30fc\u30b9\u304c\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contents1 \u6982\u89812 \u66f8\u7c4d\u6982\u89813 \u5185\u5bb9\u306e\u307e\u3068\u3081\u3068\u611f\u60f34 \u8aad\u66f8\u30ce\u30fc\u30c8(\u500b\u4eba\u7684\u306a\u307e\u3068\u3081) \u6982\u8981 \u300c\u5b9f\u8df5Django Python\u306b\u3088\u308b\u672c\u683cWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u300d\u3092\u8aad\u3093\u3060\u306e\u3067\u611f\u60f3\u7b49\u3092\u66f8\u3053\u3046\u3068\u601d\u3044 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2476,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,12],"tags":[],"_links":{"self":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/2384"}],"collection":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2384"}],"version-history":[{"count":6,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/2384\/revisions"}],"predecessor-version":[{"id":3073,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/2384\/revisions\/3073"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/media\/2476"}],"wp:attachment":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}