{"id":375624,"date":"2024-05-21T06:29:08","date_gmt":"2024-05-21T06:29:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375624"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T06:29:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375624","title":{"rendered":"<span>\u0421\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f Flask (Python) \u0432 Runtime<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041e\u0441\u0438\u043f\u043e\u0432 \u0421\u0442\u0430\u043d\u0438\u0441\u043b\u0430\u0432. \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c AppSec\/DevOps \u0441 2021 \u0433\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 runtime \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/em><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/149\/371\/9e0\/1493719e0f1e8fd74398ffe49fa59172.png\" alt=\"\u0421\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Midjourney \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438\" title=\"\u0421\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Midjourney \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438\" width=\"1456\" height=\"816\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/149\/371\/9e0\/1493719e0f1e8fd74398ffe49fa59172.png\"\/><\/p>\n<div><figcaption>\u0421\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Midjourney \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/pallets\/flask\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pallets\/flask<\/a> &#8212; Flask 3.03 <br \/><a href=\"https:\/\/github.com\/nedbat\/coveragepy\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nedbat\/coveragepy<\/a> &#8212; coverage 7.5.1 <\/p>\n<\/blockquote>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Flask <\/h2>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 Flask \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/pallets\/flask\/blob\/main\/docs\/installation.rst\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pallets\/flask\/blob\/main\/docs\/installation.rst<\/a><\/p>\n<\/blockquote>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c app.py, \u0432\u0437\u044f\u0432 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Flask, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u0440\u043e\u0443\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">import coverage, hashlib  from flask import Flask  #\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f rout'\u043e\u0432 def main():    @app.route(\"\/\")    def hello():     return \"Main route\"      @app.route(\"\/1\")   def hello1():      return \"First route\"      @app.route(\"\/2\")   def hello2():       return hashlib.sha256(b\"Nobody inspects the spammish repetition\").hexdigest()    #\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430   app.run()  #\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f app = Flask(__name__)  main()<\/code><\/pre>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 coverage<\/h2>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"bash\">pip install coverage<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f third-party \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"python\">.venv\/lib\/python3.11\/site-packages\/coverage\/inorout.py-16478:  if self.third_match.match(filename) and not self.source_in_third_match.match(filename):  .venv\/lib\/python3.11\/site-packages\/coverage\/inorout.py:16579:   return \"inside --source, but is third-party\"  <\/code><\/pre>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 <\/h2>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/coverage.readthedocs.io\/en\/7.5.1\/api.html\" rel=\"noopener noreferrer nofollow\">https:\/\/coverage.readthedocs.io\/en\/7.5.1\/api.html<\/a> \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">import coverage  cov = coverage.Coverage() #\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f cov.start() # \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f  # .. call your code ..  cov.stop() # \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f - \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c cov.save() # \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435  cov.html_report() # \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .html<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e Flask, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Flask.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<blockquote>\n<p><code>.venv\/lib\/python3.11\/site-packages\/flask\/app.py<br \/><\/code><br \/>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c coverage \u0443\u043a\u0430\u0437\u0430\u0432 \u0444\u043b\u0430\u0433\u0438:<br \/><strong>cover_pylib<\/strong> &#8212; \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 Python<br \/><strong>auto_data<\/strong> &#8212; \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b<br \/><strong>source<\/strong> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0447\u0435\u0442\u0435<\/p>\n<\/blockquote>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f coverage<\/h2>\n<pre><code class=\"python\">13a14  > import coverage<\/code><\/pre>\n<h2>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f <\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f coverage \u0432 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Flask \u0438 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"python\">253c253,254 #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 Flask \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 \"run\" \u043a\u043b\u0430\u0441\u0441\u0430 Flask &lt;  --- >         self.cov = coverage.Coverage(cover_pylib=True, auto_data=True, source=[\".\/\", \".venv\"]) >         self.cov.start()<\/code><\/pre>\n<h2>\u041f\u043e\u0438\u0441\u043a \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0439\u0434\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <br \/>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 Flask \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434 <strong>make_response<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u043e\u0440\u0441.<br \/>\u0412 \u043c\u0435\u0442\u043e\u0434\u0435 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\/\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435<\/p>\n<pre><code class=\"python\">1230c1229,1230  &lt;  --- >         self.cov.save() >         self.cov.html_report()  <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 Runtime<\/h2>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: python3 <a href=\"http:\/\/app.py\" rel=\"noopener noreferrer nofollow\">app.py<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 main route &#8212; 127.0.0.1:5000<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 &#8212; firefox htmlcov\/index.html<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5d1\/556\/4e3\/5d15564e3c9dc5a85227ab3ea39ba8cc.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f\" width=\"850\" height=\"747\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d1\/556\/4e3\/5d15564e3c9dc5a85227ab3ea39ba8cc.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435:  \u0421\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e 11% \u0432\u043c\u0435\u0441\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/strong><\/p>\n<ol>\n<li>\n<p>\u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 route &#8212; 127.0.0.1:5000\/2<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 <\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/936\/c2f\/35f\/936c2f35f999ae38602ab2c00a0ddff6.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f\" width=\"878\" height=\"757\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/936\/c2f\/35f\/936c2f35f999ae38602ab2c00a0ddff6.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435: \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0430 5 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a 2 rout&#8217;\u0443.<\/strong><\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Flask, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u044e.<\/p>\n<p><em>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! <br \/>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/812861\/\"> https:\/\/habr.com\/ru\/articles\/812861\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041e\u0441\u0438\u043f\u043e\u0432 \u0421\u0442\u0430\u043d\u0438\u0441\u043b\u0430\u0432. \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c AppSec\/DevOps \u0441 2021 \u0433\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 runtime \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/em><\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Midjourney \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/pallets\/flask\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pallets\/flask<\/a> &#8212; Flask 3.03 <br \/><a href=\"https:\/\/github.com\/nedbat\/coveragepy\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/nedbat\/coveragepy<\/a> &#8212; coverage 7.5.1 <\/p>\n<\/blockquote>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Flask <\/h2>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 Flask \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<blockquote>\n<p><a href=\"https:\/\/github.com\/pallets\/flask\/blob\/main\/docs\/installation.rst\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pallets\/flask\/blob\/main\/docs\/installation.rst<\/a><\/p>\n<\/blockquote>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c app.py, \u0432\u0437\u044f\u0432 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Flask, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u0440\u043e\u0443\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">import coverage, hashlib  from flask import Flask  #\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f rout'\u043e\u0432 def main():    @app.route(\"\/\")    def hello():     return \"Main route\"      @app.route(\"\/1\")   def hello1():      return \"First route\"      @app.route(\"\/2\")   def hello2():       return hashlib.sha256(b\"Nobody inspects the spammish repetition\").hexdigest()    #\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430   app.run()  #\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f app = Flask(__name__)  main()<\/code><\/pre>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 coverage<\/h2>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"bash\">pip install coverage<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f third-party \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"python\">.venv\/lib\/python3.11\/site-packages\/coverage\/inorout.py-16478:  if self.third_match.match(filename) and not self.source_in_third_match.match(filename):  .venv\/lib\/python3.11\/site-packages\/coverage\/inorout.py:16579:   return \"inside --source, but is third-party\"  <\/code><\/pre>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 <\/h2>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/coverage.readthedocs.io\/en\/7.5.1\/api.html\" rel=\"noopener noreferrer nofollow\">https:\/\/coverage.readthedocs.io\/en\/7.5.1\/api.html<\/a> \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">import coverage  cov = coverage.Coverage() #\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f cov.start() # \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f  # .. call your code ..  cov.stop() # \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f - \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c cov.save() # \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435  cov.html_report() # \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .html<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e Flask, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Flask.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<blockquote>\n<p><code>.venv\/lib\/python3.11\/site-packages\/flask\/app.py<br \/><\/code><br \/>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c coverage \u0443\u043a\u0430\u0437\u0430\u0432 \u0444\u043b\u0430\u0433\u0438:<br \/><strong>cover_pylib<\/strong> &#8212; \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 Python<br \/><strong>auto_data<\/strong> &#8212; \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b<br \/><strong>source<\/strong> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0447\u0435\u0442\u0435<\/p>\n<\/blockquote>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f coverage<\/h2>\n<pre><code class=\"python\">13a14  > import coverage<\/code><\/pre>\n<h2>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f <\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f coverage \u0432 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Flask \u0438 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"python\">253c253,254 #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 Flask \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 \"run\" \u043a\u043b\u0430\u0441\u0441\u0430 Flask &lt;  --- >         self.cov = coverage.Coverage(cover_pylib=True, auto_data=True, source=[\".\/\", \".venv\"]) >         self.cov.start()<\/code><\/pre>\n<h2>\u041f\u043e\u0438\u0441\u043a \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0439\u0434\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <br \/>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 Flask \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434 <strong>make_response<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u043e\u0440\u0441.<br \/>\u0412 \u043c\u0435\u0442\u043e\u0434\u0435 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\/\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435<\/p>\n<pre><code class=\"python\">1230c1229,1230  &lt;  --- >         self.cov.save() >         self.cov.html_report()  <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0431\u043e\u0440 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 Runtime<\/h2>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: python3 <a href=\"http:\/\/app.py\" rel=\"noopener noreferrer nofollow\">app.py<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 main route &#8212; 127.0.0.1:5000<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 &#8212; firefox htmlcov\/index.html<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435:  \u0421\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e 11% \u0432\u043c\u0435\u0441\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/strong><\/p>\n<ol>\n<li>\n<p>\u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 route &#8212; 127.0.0.1:5000\/2<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 <\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435: \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0430 5 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a 2 rout&#8217;\u0443.<\/strong><\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Flask, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u044e.<\/p>\n<p><em>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! <br \/>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/812861\/\"> https:\/\/habr.com\/ru\/articles\/812861\/<\/a><br \/><\/br><\/br><\/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-375624","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375624","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=375624"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375624\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}