{"id":298800,"date":"2020-02-17T15:00:09","date_gmt":"2020-02-17T15:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298800"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298800","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0435\u043c Todo \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e Django. \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/488748\/\"><i>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/2ZBR\/\">\u00abWeb-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python\u00bb<\/a> \u043d\u0430\u0448 \u0432\u043d\u0435\u0448\u0442\u0430\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u0440 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fj\/ze\/xp\/fjzexptqv3s9n9nqjpg5wvl-xog.png\">  <\/p>\n<hr>\n<p>  \u0414\u0436\u0430\u043d\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Django \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b (\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0430\u0439\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e). \u0418 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e PHP \u043d\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u044b \u0435\u0434\u0435\u0448\u044c \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 Todo \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/js\/cr\/kg\/jscrkgjwti_yxuwa87dnxygdupo.jpeg\"><\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u0440\u0430\u0442\u043a\u043e\u0433\u043e \u0442.\u0437. \u0423 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u043d\u0430 Bulma (\u0434\u0430, \u044f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e Bulma. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u044f \u0441\u0432\u0435\u0440\u043d\u0443 \u043d\u0430 Bootstrap \u0438\u043b\u0438 Picnic, \u043d\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f). \u0423 \u043d\u0430\u0441 (\u043f\u043e\u043a\u0430) \u043d\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0434\u0435\u043b, \u043b\u0438\u0431\u043e \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 todo, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. Todo \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u043d\u0430 checkbox \u0438 \u043d\u0430\u0436\u0430\u0432 \u043a\u043d\u043e\u043f\u043a\u0443 \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<h3> \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Django<\/h3>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e Django. Django \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d MVT (\u041c\u043e\u0434\u0435\u043b\u044c \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0428\u0430\u0431\u043b\u043e\u043d), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 MVC (\u041c\u043e\u0434\u0435\u043b\u044c \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440) \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Ruby on Rails \u0438 Laravel.<\/p>\n<p>  <b> \u041c\u043e\u0434\u0435\u043b\u044c (Model)<\/b> \u041c\u043e\u0434\u0435\u043b\u044c \u0432 Django \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0445\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0411\u0414. \u0421 Django ORM, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (View)<\/b> \u0412 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 Django \u0432\u044b \u0437\u0430\u0434\u0430\u0435\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u043c\u0438. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 request\\response. Response \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043e\u0431\u044b\u0447\u043d\u043e HTTP redirect, HTTP error(404), MimeTypes \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>  <b> \u0428\u0430\u0431\u043b\u043e\u043d <\/b> \u0428\u0430\u0431\u043b\u043e\u043d \u0432 Django \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 HTML \u043a\u043e\u0434 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c Django. DTL (Django Template Language) \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u043e\u0432\u0443\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f).<\/p>\n<p>  <b> \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <\/b> \u0424\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 Django, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u043f\u0430\u043f\u043a\u0438 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438, middlewares (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0430\u043b\u044c\u0431\u043e\u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438), \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e.<\/p>\n<p>  <b> Url<\/b> \u0424\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0432 Angular \u0438\u043b\u0438 Laravel. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 url \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438.<\/p>\n<p>  <b> \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0410\u0434\u043c\u0438\u043d\u0430<\/b> \u0422\u0430\u043a \u043a\u0430\u043a Django \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u0430\u0434\u043c\u0438\u043d\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h3> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Python \u0438 Django<\/h3>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\u0410\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u044f) \u043a\u0440\u043e\u043c\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u043f\u0438\u0442\u043e\u043d\u0430 \u0434\u0435\u0442\u0435\u0439. \u041f\u043e \u0434\u043e\u043b\u0433\u0443 \u0441\u043b\u0443\u0436\u0431\u044b \u044f \u0441\u0442\u0430\u0432\u0438\u043b Python \u0438 \u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d. \u0418 \u043a\u0440\u043e\u043c\u0435 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u043f\u0438\u0442\u043e\u043d\u0430, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0434\u0430\u0436\u0435 \u0434\u0430\u0443\u043d\u0433\u0440\u0435\u0439\u0434 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430. \u0414\u0430, \u0442\u0430\u043a \u0442\u043e\u0436\u0435 \u0431\u044b\u0432\u0430\u0435\u0442. <\/div>\n<\/div>\n<h4>\u0412\u0435\u0440\u0441\u0438\u0438 Python<\/h4>\n<p>  \u0414\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0435\u0442\u043a\u0438 Python: 2.7 \u0438 3.x. \u042f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e 3.7.3 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0430\u0432\u0434\u0430 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/wiki.python.org\/moin\/Python2orPython3\">\u0432\u0438\u043a\u0438<\/a>. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0432\u0435\u0440\u0441\u0438\u0438 2.7 \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0430 2.7.17 (\u0435\u0441\u043b\u0438 \u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 Python 2.7.x \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u0430 \u0432\u043e\u0442 \u043d\u043e\u0432\u044b\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 2 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e.<\/p>\n<h3>\u0418\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f Python<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043d\u0430 Mac \u0438\u043b\u0438 Ubuntu \u2014 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python, \u043e\u0434\u043d\u0430\u043a\u043e 2 \u0432\u0435\u0440\u0441\u0438\u0438. Python \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 python3. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u043b\u0438\u0437 <a href=\"https:\/\/www.python.org\/downloads\/\"> \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Django \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0432\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0432\u044b\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0432\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0438 \u0437\u0430\u043c\u0443\u0441\u043e\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0430\u0448 system.<\/p>\n<p>  <i>\u0422\u0430\u043a \u043a\u0430\u043a \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c virtual env?<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zr\/ad\/dh\/zraddhn6g-mcadwn6xn-7ys1yim.png\"><\/p>\n<p>  1) \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 IDE \u043e\u0442 JET BRAINS PyCharm Community Edition <a href=\"https:\/\/www.jetbrains.com\/ru-ru\/pycharm\/\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PyCharm \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438 Pycharm \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c Virtual Env, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Django (\u0438\u043b\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 3.0.2):<\/p>\n<pre><code class=\"plaintext\">pip3 install django <\/code><\/pre>\n<p>  2) \u0427\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Django \u0432 virtual env, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u043f\u0430\u043f\u043a\u0435?<br \/>  \u0412\u043e, \u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0442\u0432\u043e\u0440\u0438\u0442\u044c:<\/p>\n<pre><code class=\"plaintext\">\tmkdir myfirstdjango &amp;&amp; cd myfirstdjango <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 venv, \u0433\u0434\u0435 django_env \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"plaintext\">\tpython3 -m venv django_env \tsource django_env\/bin\/activate <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0448\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c. \u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e Django:<\/p>\n<pre><code class=\"plaintext\">\tpip3 install django <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0432\u0430\u0448 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 python (\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 system), \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"plaintext\">    deactivate <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/python-scripts.com\/virtualenv\">\u0437\u0434\u0435\u0441\u044c <\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/venv.html\">\u0437\u0434\u0435\u0441\u044c <\/a>.<\/p>\n<h3> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0432\u0441\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0436\u0435, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0432\u0430\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c). \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"plaintext\">    django-admin startproject todo  #\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430     cd todo #\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0435     python manage.py startapp todolist  #\u043a\u0430\u043a \u0431\u044b \u043f\u043e\u0434\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 todolist \tpython3 manage.py runserver 8100 #\u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043b\u044e\u0431\u0438\u043c\u043e\u043c \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u043e\u043c \u043f\u043e\u0440\u0442\u0435, 8000 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e  <\/code><\/pre>\n<p>  \u0422\u0430\u043a, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a Django \u043e\u0442\u043a\u0440\u044b\u043b \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 todolist \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>settings.py<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 todolist:<\/p>\n<pre><code class=\"python\">INSTALLED_APPS = [ \t#\u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u0434\u043c\u0438\u043d\u043a\u0438, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c     'todolist', ] <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e, \u0441 \u0447\u0435\u043c \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 SQlite. \u042f \u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f PostgreSQL \u2014 \u043e\u043d\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430 \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 Django, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0442\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c PostgreSQL \u043d\u0430 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e. \u042f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u043f\u043e\u0434 MacOS \u0438 \u043d\u0435 \u0431\u0435\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c \u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043a\u0430\u0447\u0430\u0432 \u0441\u0430\u043c Postgres.app <a href=\"https:\/\/www.postgresql.org\/download\/\">\u043e\u0442\u0441\u044e\u0434\u0430 <\/a>. \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0411\u0414, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <a href=\"https:\/\/eggerapps.at\/postico\/\">Postico <\/a> \u0438 \u043f\u0440\u043e\u0431\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442 (\u0445\u043e\u0442\u044f \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0451, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u043c\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <i>psycopg2<\/i> \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0441 \u0411\u0414 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442).<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0442\u0430\u0442\u0438\u043a\u0438. \u041f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b <code>settings.py<\/code>, \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u043a\u043e\u0439:<\/p>\n<pre><code class=\"python\">STATIC_URL = '\/static\/' PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443 \u0432\u0430\u0441 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u0438\u043a\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <i>INSTALLED_APPS<\/i> \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u0430\u043a\u0435\u0442, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0441\u0442\u0430\u0442\u0438\u043a\u0443:<\/p>\n<p>  <code>django.contrib.staticfiles,<\/code> \u043d\u0430 \u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430.<br \/>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0451 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 url \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435:<\/p>\n<pre><code class=\"python\">\tfrom django.conf.urls import url \tfrom django.contrib import admin \tfrom todolist.views import todo \tfrom todolist.views import category \tfrom todolist.views import redirect_view   urlpatterns = [ \turl(r'$^', redirect_view ), \turl(r'^admin\/', admin.site.urls), \turl(r'^todo\/', todo, name=&quot;TodoList&quot;), \turl(r'^category\/', category, name=&quot;Category&quot;), ] <\/code><\/pre>\n<p>  \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0442\u0430\u043a \u043a\u0430\u043a \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <i>localhost<\/i> \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043b \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <i>category<\/i>(\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0430\u0439 \u0431\u043e\u0433 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0441\u044f). \u0422\u0430\u043a\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u043d\u0430 \u0434\u0432\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b: \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0438 \u0434\u0435\u043b.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043f\u0430\u043b\u043e. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<h4> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 Todo \u0438 \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439<\/h4>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>models.py<\/code> \u0432 \u043d\u0430\u0448\u0435\u043c todolist \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0442\u0432\u043e\u0440\u0438\u0442\u044c. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439:<\/p>\n<pre><code class=\"python\">from django.utils import timezone #\u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u0442\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f todo from django.db import models   class Category(models.Model): # \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 models.Model     name = models.CharField(max_length=100) #varchar.\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \tclass Meta:     \tverbose_name = (&quot;Category&quot;) # \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430     \tverbose_name_plural = (&quot;Categories&quot;)  #\u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439     def __str__(self):         return self.name  # __str__ \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0414\u0430, \u0437\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439: id \u0438 name. \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u043b. \u0414\u0443\u043c\u0430\u044e, \u0438\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e:<\/p>\n<pre><code class=\"python\">class TodoList(models.Model): \ttitle = models.CharField(max_length=250) \tcontent = models.TextField(blank=True) #\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \tcreated = models.DateField(default=timezone.now().strftime(&quot;%Y-%m-%d&quot;)) # \u0434\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \tdue_date = models.DateField(default=timezone.now().strftime(&quot;%Y-%m-%d&quot;)) #\u0434\u043e \u043a\u0430\u043a\u043e\u0439 \u0434\u0430\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043b\u043e \tcategory = models.ForeignKey(Category, default=&quot;general&quot;,on_delete=models.PROTECT) # foreignkey \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \tclass Meta: #\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043c\u0435\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u043b         ordering = [&quot;-created&quot;] #\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u0435\u043b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \tdef __str__(self):     \treturn self.title <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"plaintext\">\tpython3 manage.py makemigrations <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"plaintext\">\tpython3 manage.py migrate <\/code><\/pre>\n<h4> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 view <\/h4>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b <code>view.py<\/code> \u0432 todolist \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043d\u0430 category:<\/p>\n<pre><code class=\"python\">from django.shortcuts import render, redirect #\u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u0431\u0435\u0440\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b from django.http import HttpResponse from .models import TodoList, Category #\u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438   def redirect_view(request): \treturn redirect(&quot;\/category&quot;) # \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043d\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u043e\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0435\u043b\u0430. \u0423 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0434\u0435\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0434\u0430\u0442\u044b, \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \u0434\u0435\u043b\u043e, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0434\u0435\u043b\u0430, \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442:<\/p>\n<pre><code class=\"python\">def todo(request): \ttodos = TodoList.objects.all() #\u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b todo \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432     categories = Category.objects.all() #\u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u043b:<\/p>\n<pre><code class=\"python\">if request.method == &quot;POST&quot;: #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0442\u043e \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e POST \tif &quot;Add&quot; in request.POST: #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f todo     \ttitle = request.POST[&quot;description&quot;] #\u0441\u0430\u043c \u0442\u0435\u043a\u0441\u0442     \tdate = str(request.POST[&quot;date&quot;]) #\u0434\u0430\u0442\u0430, \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \u0434\u0435\u043b\u043e         category = request.POST[&quot;category_select&quot;] #\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.         content = title + &quot; -- &quot; + date + &quot; &quot; + category # \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043a\u043b\u0435\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442     \tTodo = TodoList(title=title, content=content, due_date=date, category=Category.objects.get(name=category))     \tTodo.save() # \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0435\u043b\u0430         return redirect(&quot;\/todo&quot;) # \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u043d\u0443 \u0432\u043e\u0442 \u0442\u0430\u043a \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u044b)     if &quot;Delete&quot; in request.POST: #\u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u0435\u043b\u043e         checkedlist = request.POST.getlist('checkedbox') # \u0431\u0435\u0440\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c         for i in range(len(checkedlist)): #\u043c\u043d\u0435 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f             todo = TodoList.objects.filter(id=int(checkedlist[i]))         \ttodo.delete() #\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430 return render(request, &quot;todo.html&quot;, {&quot;todos&quot;: todos, &quot;categories&quot;: categories}) <\/code><\/pre>\n<p>  \u0421 \u0442\u0443\u0434\u0443\u0448\u043a\u0430\u043c\u0438 \u0432\u0441\u0435. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438. \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0443 \u043d\u0430\u0441 \u0442\u0430\u043a \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"plaintext\">def category(request): \tcategories = Category.objects.all()  #\u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \tif request.method == &quot;POST&quot;: #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 POST     \tif &quot;Add&quot; in request.POST: #\u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c         \tname = request.POST[&quot;name&quot;] #\u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438         \tcategory = Category(name=name) #\u0443 \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f             category.save() # \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438         \treturn redirect(&quot;\/category&quot;)     \tif &quot;Delete&quot; in request.POST: # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435             check = request.POST.getlist('check') #\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 todo, \u0447\u0442\u043e \u0431\u044b \u0431\u044b\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u043a\u043e\u0434\u0435             for i in range(len(check)):             \ttry:                 \t\u0441ateg = Category.objects.filter(id=int(check[i]))                 \t\u0441ateg.delete()   #\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438             \texcept BaseException: # \u0432\u043d\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u0442\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u044d\u0442\u043e\u0433\u043e                 \treturn HttpResponse('&lt;h1&gt;\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0441 \u044d\u0442\u0438\u043c\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c\u0438)&lt;\/h1&gt;') \treturn render(request, &quot;category.html&quot;, {&quot;categories&quot;: categories}) <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0441 \u0444\u0430\u0439\u043b\u043e\u043c <code>view<\/code> \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c:<\/p>\n<h4> \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 <\/h4>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c css \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437, \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <code>bulma.css<\/code> \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0442\u043a\u0438. \u0422.\u043a. \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0438 todo \u0431\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0441\u0445\u043e\u0436\u0438, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430:<br \/>  <code>base.html<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445, \u0430 \u0432 <code>category.html<\/code>, <code>todo.html<\/code> \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zr\/ad\/dh\/zraddhn6g-mcadwn6xn-7ys1yim.png\"><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>base.html<\/code> \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;ru&quot;&gt; &lt;head&gt;   &lt;meta charset=&quot;UTF-8&quot;&gt;   &lt;title&gt; \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u043b&lt;\/title&gt;   {% load static %} \t&lt;link rel=&quot;shortcut icon&quot; type=&quot;image\/png&quot; href=&quot;{% static 'favicon.png' %}&quot;\/&gt;    &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;{% static 'bulma.min.css' %}&quot;&gt; \t&lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/stackpath.bootstrapcdn.com\/font-awesome\/4.7.0\/css\/font-awesome.min.css&quot;&gt; &lt;\/head&gt; &lt;body&gt; &lt;div django-app=&quot;TaskManager&quot;&gt; \t&lt;nav class =&quot;navbar is-success&quot; role=&quot;navigation&quot; aria-label=&quot;main navigation&quot;&gt;      \t&lt;div class=&quot;navbar-menu &quot;&gt;         \t&lt;div class=&quot;navbar-start&quot;&gt;         \t&lt;a class=&quot;navbar-item&quot; href=&quot;..\/category&quot;&gt; \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438&lt;\/a&gt;         \t&lt;a class=&quot;navbar-item&quot; href=&quot;..\/todo&quot;&gt; \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b &lt;\/a&gt;         \t&lt;\/div&gt;          &lt;\/div&gt; \t&lt;\/nav&gt; &lt;!--     \u0432 \u0431\u043b\u043e\u043a \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0438 \u0442\u0443\u0434\u0443\u0448\u0435\u043a--&gt; {% block content %} {% endblock %} &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u0439\u0434\u0443\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<code> todo.html<\/code> \u0438 <code>category.html<\/code>:<\/p>\n<p>  <i>\u0422\u0443\u0434\u0443\u0448\u043a\u0430:<\/i><\/p>\n<pre><code class=\"html\">{% extends 'base.html' %} {% block content %} &lt;div class=&quot;columns has-background-black-ter is-centered has-text-white-bis&quot; style=&quot;min-height:101vh;&quot;&gt; \t&lt;!-- \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 hero, \u043d\u043e \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u043a inline-css --&gt; \t&lt;div class=&quot;column is-half&quot;&gt;     \t&lt;h1 class=&quot;is-size-3 has-text-centered&quot;&gt; \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b &lt;\/h1&gt;     \t&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;         \t{% csrf_token %}         \t&lt;!-- csrf \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f --&gt;             &lt;div class=&quot;field has-text-centered&quot;&gt;             \t&lt;label for=&quot;description&quot; class=&quot;label has-text-white-bis&quot;&gt;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0435\u043b\u043e&lt;\/label&gt;             \t&lt;div class=&quot;control&quot;&gt;              \t   &lt;input type=&quot;text&quot; id=&quot;description&quot; class=&quot;input&quot; placeholder=&quot;\u0427\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f?&quot;                     \tname=&quot;description&quot; required&gt;             \t&lt;\/div&gt;         \t&lt;\/div&gt;         \t&lt;div class=&quot;columns&quot;&gt;             \t&lt;div class=&quot;column&quot;&gt;                 \t&lt;label for=&quot;category&quot;&gt;\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438&lt;\/label&gt;                 \t&lt;div class=&quot;control&quot;&gt;                     \t&lt;div class=&quot;select&quot;&gt;                         \t&lt;select id=&quot;category&quot; class=&quot;select&quot; name=&quot;category_select&quot; required&gt;                             \t&lt;!--\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0448\u044c \u0442\u0430\u043a\u043e\u0439 required, \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u043b\u044f\u0432 \u0431\u0434 \u0432\u0430\u043b\u0438\u0434\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435--&gt;                             \t&lt;option class=&quot;disabled&quot; value=&quot;&quot;&gt;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0434\u0435\u043b\u0430&lt;\/option&gt;                     \t        {% for category in categories %}  \t                           &lt;option class=&quot;&quot; value=&quot;{{ category.name }}&quot; name=&quot;{{ category.name }}&quot;&gt;                                     {{ category.name }}&lt;\/option&gt;                             \t{% endfor %}                         \t&lt;\/select&gt;     \t                &lt;\/div&gt;                 \t&lt;\/div&gt;             \t&lt;\/div&gt;             \t&lt;div class=&quot;column&quot;&gt;                 \t&lt;label for=&quot;dueDate&quot;&gt;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0430\u0442\u0443&lt;\/label&gt;                 \t&lt;input type=&quot;date&quot; id=&quot;dueDate&quot; class=&quot;input calendar&quot; name=&quot;date&quot; required&gt;             \t&lt;\/div&gt;         \t&lt;\/div&gt;         \t&lt;div class=&quot;column&quot;&gt;             \t&lt;div class=&quot;field&quot;&gt;                 \t&lt;button class=&quot;button is-primary&quot; name=&quot;Add&quot; type=&quot;submit&quot;&gt;                     \t&lt;span class=&quot;icon is-small&quot;&gt;                         \t&lt;i class=&quot;fa fa-plus&quot;&gt;&lt;\/i&gt;                     \t&lt;\/span&gt;                     \t&lt;span&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435&lt;\/span&gt;                 \t&lt;\/button&gt;              \t   &lt;button class=&quot;button is-link&quot; name=&quot;Delete&quot; formnovalidate=&quot;&quot; type=&quot;submit&quot;&gt;                     \t&lt;span class=&quot;icon is-small&quot;&gt;                         \t&lt;i class=&quot;fa fa-trash-o&quot;&gt;&lt;\/i&gt;                     \t&lt;\/span&gt;                     \t&lt;span&gt;                         \t\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0435\u043b\u043e                     \t&lt;\/span&gt;                 \t&lt;\/button&gt;             \t&lt;\/div&gt;         \t&lt;\/div&gt;         \t&lt;div class=&quot;list is-hoverable&quot;&gt;             \t{% for todo in todos %}             \t&lt;!-- \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a django- for loop --&gt;             \t&lt;div class=&quot;list-item&quot;&gt;                 \t&lt;label class=&quot;checkbox&quot;&gt;                     \t&lt;input type=&quot;checkbox&quot; class=&quot; checkbox&quot; name=&quot;checkedbox&quot; value=&quot;{{ todo.id }}&quot;&gt;                     \t&lt;span class=&quot;complete-&quot;&gt;{{ todo.title }}&lt;\/span&gt;                 \t&lt;\/label&gt;                 \t&lt;span class=&quot; category-{{ todo.category }} has-text-info&quot;&gt;{{ todo.category }}&lt;\/span&gt;                 \t&lt;strong class=&quot;is-pulled-right&quot;&gt;&lt;i class=&quot;fa fa-calendar&quot;&gt;&lt;\/i&gt;{{ todo.created }} -                     \t{{ todo.due_date }}&lt;\/strong&gt;             \t&lt;\/div&gt;             \t{% endfor %}         \t&lt;\/div&gt;     \t&lt;\/form&gt; \t&lt;\/div&gt; &lt;\/div&gt; {% endblock %} <\/code><\/pre>\n<p>  \u0418 <code>category.html<\/code>. \u0412 \u043d\u0435\u0439 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442<code> todo.html<\/code>:<\/p>\n<pre><code class=\"html\">{% extends 'base.html' %} {% block content %} &lt;div class=&quot;columns has-background-link has-text-white is-centered&quot; style=&quot;min-height: 101vh;&quot;&gt; \t&lt;div class=&quot;column is-half&quot;&gt;     \t&lt;h1 class=&quot;is-size-4 has-text-centered&quot;&gt; \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0430\u0448\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 &lt;\/h1&gt;     \t&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;         \t{% csrf_token %}         \t&lt;!-- csrf \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f --&gt;             &lt;div class=&quot;field has-text-centered&quot;&gt;             \t&lt;label for=&quot;description&quot; class=&quot;label has-text-white-bis&quot;&gt; \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 &lt;\/label&gt;             \t&lt;div class=&quot;control&quot;&gt;      \t           &lt;input type=&quot;text&quot; id=&quot;description&quot; class=&quot;input&quot; placeholder=&quot;\u041a\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0434\u0435\u043b\u0430?&quot;                     \tname=&quot;name&quot; required&gt;             \t&lt;\/div&gt;             \t&lt;div class=&quot;field&quot;&gt;                 \t&lt;button class=&quot;button is-primary&quot; name=&quot;Add&quot; type=&quot;submit&quot;&gt;                     \t&lt;span class=&quot;icon is-small&quot;&gt;                         \t&lt;i class=&quot;fa fa-plus&quot;&gt;&lt;\/i&gt;                     \t&lt;\/span&gt;                     \t&lt;span&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e&lt;\/span&gt;                 \t&lt;\/button&gt;                 \t&lt;button class=&quot;button is-danger&quot; name=&quot;Delete&quot; formnovalidate=&quot;&quot; type=&quot;submit&quot;&gt;                     \t&lt;span class=&quot;icon is-small&quot;&gt;            \t             &lt;i class=&quot;fa fa-trash-o&quot;&gt;&lt;\/i&gt;                     \t&lt;\/span&gt; \t                    &lt;span&gt; \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e &lt;\/span&gt;                 \t&lt;\/button&gt;             \t&lt;\/div&gt;             &lt;\/div&gt;               &lt;!--  c\u043f\u0438\u0441\u043e\u043a \u043d\u0430\u0448\u0438\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 --&gt;             &lt;div class=&quot;list is-hoverable&quot;&gt;             \t{% for category in categories %}             \t&lt;div class=&quot;list-item&quot;&gt;                 \t&lt;label class=&quot;checkbox&quot;&gt;                     \t&lt;input type=&quot;checkbox&quot; class=&quot;checkbox&quot; name=&quot;check&quot; value=&quot;{{category.id}}&quot;&gt;                     \t&lt;span class=&quot;complete-&quot;&gt;{{ category.name }}&lt;\/span&gt;                 \t&lt;\/label&gt;             \t&lt;\/div&gt;             \t{% endfor %}           \t&lt;\/div&gt;     \t&lt;\/form&gt; \t&lt;\/div&gt;     {% endblock %}   <\/code><\/pre>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e! \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0433\u0434\u0435-\u0442\u043e \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430 \u0432\u0435\u0440\u0441\u0442\u043a\u0430, \u0438\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0441\u0435\u0445 \u0436\u0434\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:<\/p>\n<ol>\n<li> \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/docs.djangoproject.com\/en\/3.0\/\"> \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <\/a> Django, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u043e\u0439 3 \u0432\u0435\u0440\u0441\u0438\u0438 <\/li>\n<li>\u0412 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0433\u0430\u0439\u0434\u043e\u0432 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u041e\u041e\u041f, \u043d\u043e <a href=\"https:\/\/python-scripts.com\/object-oriented-programming-in-python#attributes\"> \u044d\u0442\u043e\u0442 <\/a> \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c <\/li>\n<li> \u0420\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/9.6\/index\">PostgreSQL<\/a><\/li>\n<\/ol>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/488748\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/488748\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/488748\/\"><i>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/2ZBR\/\">\u00abWeb-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python\u00bb<\/a> \u043d\u0430\u0448 \u0432\u043d\u0435\u0448\u0442\u0430\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u0440 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fj\/ze\/xp\/fjzexptqv3s9n9nqjpg5wvl-xog.png\">  <\/p>\n<hr>\n<p>  \u0414\u0436\u0430\u043d\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Django \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b (\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0430\u0439\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e). \u0418 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e PHP \u043d\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u044b \u0435\u0434\u0435\u0448\u044c \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 Todo \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-298800","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298800"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298800\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}