{"id":426595,"date":"2024-07-18T15:00:54","date_gmt":"2024-07-18T15:00:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=426595"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=426595","title":{"rendered":"<span>\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 SMS \u0438 Flask \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445-\u0441\u0430\u043c\u044b\u0445 \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e SMS. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article&amp;utm_term=sms_api_exolve\">MTC Exolve<\/a> \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flask. \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043b\u0435\u0433\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043d\u0430\u043f\u0440\u044f\u0436\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ca9\/51b\/7fd\/ca951b7fd7d85ff91053e107c421ff30.png\" width=\"668\" height=\"656\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ca9\/51b\/7fd\/ca951b7fd7d85ff91053e107c421ff30.png\"\/><\/figure>\n<h3>\u0423\u0432\u044b, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438, \u043d\u043e \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0445\u043e\u0434 \u043f\u043e SMS<\/h3>\n<p>\u0427\u0430\u0441\u0442\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u0430\u0440\u0443 \u0438\u0437 \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u2014 \u0432\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 SMS-\u043a\u043e\u0434. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/758148\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0423\u0442\u043e\u0447\u043d\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0445\u0430\u043a\u0435\u0440\u0441\u043a\u0438\u0445 \u0438 \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u0442\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438. \u0426\u0435\u043b\u044c \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u0442\u0430\u043a \u2014 \u0437\u0430\u0432\u043b\u0430\u0434\u0435\u0442\u044c \u043b\u0438\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439: \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438, \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u043e\u043c\u0435\u0440\u0443 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 SMS \u0434\u043b\u044f \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430. \u041c\u044b \u0436\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u0440\u0435\u0434\u043a\u0438\u0445 \u0438 \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u044b \u0431\u0435\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u0445\u043e\u0434 \u043f\u043e \u043a\u043e\u0434\u0443 \u0438\u0437 SMS \u0443\u0434\u043e\u0431\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d, \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u043e\u043a\u0430\u0446\u0438\u0439. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u0440\u043e\u0437\u044b \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article&amp;utm_term=sms_api_exolve\">SMS API<\/a> \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b MTC Exolve \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Flask. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e API-\u043a\u043b\u044e\u0447 \u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 SMS \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Flask\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/h3>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 Flask? \u041e\u043d \u043d\u0435\u043f\u043b\u043e\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e Python \u0438 \u043d\u0443\u0436\u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 SMS-\u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Flask-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Flask \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 requests: pip install Flask requests<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<pre><code class=\"css\">flasksms\/     \/venv     \/templates         signup.html         verify.html    start.html    result.html    error.html     app.py     config.py     dev.env<\/code><\/pre>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/h4>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>templates<\/code> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u044f\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><code>signup.html<\/code> \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><code>start.html<\/code> \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p><code>error.html<\/code> \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u0432\u043e\u0434\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><code>result.html<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><code>verify.html<\/code> \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e SMS-\u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c.\u00a0\u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0424\u0430\u0439\u043b <code>app.py<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 Flask-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 SMS-\u043a\u043e\u0434\u0430 \u0438 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c <code>generated_codes<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b <code>config.py<\/code>:<\/p>\n<pre><code class=\"css\">from dotenv import dotenv_values  info_env = dotenv_values('dev.env')  API_KEY = info_env.get('API_KEY') PHONE_SEND = info_env.get('PHONE_SEND')<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 <code>app.py<\/code>:<\/p>\n<pre><code class=\"css\">from flask import Flask, render_template, request, jsonify import requests import random import string from config import API_KEY, PHONE_SEND  app = Flask(__name__)   # \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f app.secret_key = API_KEY  # \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 phone_send = PHONE_SEND   # \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 generated_codes = {}  @app.route('\/', methods=['GET'])  def start():   return render_template('start.html')<\/code><\/pre>\n<p>\u0421\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 html \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html lang=\"en\"> &lt;head> &lt;meta charset=\"UTF-8\"> &lt;title>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c&lt;\/title> &lt;style> body { background-color: white; font-family: Arial, sans-serif; text-align: center; } h3 { margin-top: 80px; } &lt;\/style> &lt;\/head> &lt;body> &lt;h3>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c&lt;\/h3> &lt;h5>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 flask \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0433\u043e SMS-\u043a\u043e\u0434\u0430&lt;\/h5> &lt;p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 &lt;a href=\"http:\/\/0.0.0.0:5000\/signup\">\u0437\u0434\u0435\u0441\u044c&lt;\/a>.&lt;\/p> &lt;p>--------------------------------------------------------------&lt;\/p> &lt;\/body> &lt;\/html> <\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <strong>\/singup<\/strong> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430:<\/p>\n<pre><code class=\"css\">@app.route('\/signup', methods=['GET', 'POST'])  def signup():  if request.method == 'POST': number = request.form['number']   # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 5 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0445 \u0431\u0443\u043a\u0432  code = ''.join(random.choice(string.ascii_letters) for _ in range(5))   # \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c SMS \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c  sms_data = { \"number\": phone_send, \"destination\": number, \"text\": code}  headers = {'Authorization': f'Bearer {API_KEY}'}  response = requests.post(url=\"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\", json=sms_data, headers=headers)  if response.status_code == 200:  # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438  generated_codes[number] = code  return render_template('verify.html', number=number)  else:  return f\"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS: {response.status_code}\"   return render_template('signup.html')<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e number \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437 \u0442\u0435\u0433\u0430 input \u0448\u0430\u0431\u043b\u043e\u043d\u0430 <code>signup.html<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>SMS Signup&lt;\/title> &lt;style> .container { width: 33.33%; margin: 0 auto; }        label { display: block; } input[type=\"text\"] { width: 70%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 10px; } button[type=\"submit\"] { background-color: #7FBB28; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; } button[type=\"submit\"]:hover { background-color: #7F\u0421B10; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"container\"> &lt;h1>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e SMS&lt;\/h1> &lt;form method=\"POST\" action=\"\/signup\"> &lt;label for=\"number\">\u041d\u043e\u043c\u0435\u0440 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e:&lt;\/label> &lt;input type=\"text\" name=\"number\" placeholder=\"+7 --- --- -- --\" required> &lt;button type=\"submit\">\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434&lt;\/button> &lt;\/form> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>requests.post(url=\"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\", json=sms_data, headers=headers)<\/code> \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 SMS \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0432 \u0444\u043e\u0440\u043c\u0443. \u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 headers \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 API-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 SMS \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d <code>verify.html<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043b\u044f \u0441\u0432\u0435\u0440\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0432\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"css\">@app.route('\/verify\/&lt;number>', methods=['GET', 'POST'])  def verify(number):  if request.method == 'POST':  entered_code = request.form['code']  if number in generated_codes and entered_code == generated_codes[number]:  pasport = ''.join(str(random.randint(0, 9)) for _ in range(10)) credit = ''.join(str(random.randint(0, 9)) for _ in range(16)) data = {\u201c\u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\u201d: credit, \u201c\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430\u201d: pasport} return render_template('result.html', data=data)   else:  return render_template('error.html')   return render_template('verify.html', number=number)<\/code><\/pre>\n<p>\u0420\u0430\u0437 \u043c\u044b \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 verify.html, \u0442\u043e \u0435\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u0438\u0436\u0435 \u0441\u0442\u0438\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e \u0432\u043a\u0443\u0441\u0443:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435&lt;\/title> &lt;style> .container { width: 33.33%; margin: 0 auto; } label { display: block; }  input[type=\"text\"] { width: 70%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 10px; }  button[type=\"submit\"] { background-color: #9eccc1; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }   button[type=\"submit\"]:hover { background-color: #9ec1cc; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"container\"> &lt;h1>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430&lt;\/h1> &lt;form method=\"POST\" action=\"\/verify\/{{ number }}\"> &lt;label for=\"code\">\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434:&lt;\/label> &lt;input type=\"text\" name=\"code\" required> &lt;button type=\"submit\">\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c&lt;\/button> &lt;\/form> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432 \u0442\u0435\u0433\u0435 input \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u0432\u043e\u0434 \u043a\u043e\u0434\u0430 \u0438 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 button \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <strong>\/verify\/&lt;number><\/strong>. \u0415\u0441\u043b\u0438 \u043a\u043e\u0434, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 generated_codes[number], \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043e\u0442\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d result.html, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043b\u0430\u0434\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430 \u0438 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043d\u0435\u043c. \u0422\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;style> table { border-collapse: collapse; margin: 0 auto; } th, td { padding: 10px; text-align: left; } th { background-color: #f2f2f2; border-radius: 10px 10px 0 0; } td { border-bottom: 1px solid #ddd; } &lt;\/style> &lt;\/head> &lt;body> &lt;table> &lt;tr> &lt;th>\u041d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430&lt;\/th> &lt;td>{{ data['\u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430'] }}&lt;\/td> &lt;\/tr> &lt;tr> &lt;th>\u041d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430&lt;\/th> &lt;td>{{ data['\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430'] }}&lt;\/td> &lt;\/tr> &lt;\/table> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0434 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0432\u0435\u0440\u043d\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <code>error.html<\/code> \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;style> body { text-align: center; font-family: Arial, sans-serif; } .message { margin-top: 100px; font-size: 24px; color: red; } .link { margin-top: 20px; font-size: 16px; text-decoration: none; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"message\">\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435, \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434.&lt;\/div> &lt;a class=\"link\" href=\"http:\/\/0.0.0.0:5000\/signup\">\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430&lt;\/a> &lt;\/body> &lt;\/html><\/code><\/pre>\n<h3>\u0412 \u043a\u0430\u043a\u0438\u0445 \u0435\u0449\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f OTP \u0447\u0435\u0440\u0435\u0437 SMS<\/h3>\n<ul>\n<li>\n<p><strong>\u0414\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/strong>, <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/755006\/\">\u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435<\/a>. \u041e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 SMS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/strong> \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043b\u0438\u0447\u043d\u043e\u0441\u0442\u044c. \u0418\u043d\u043e\u0433\u0434\u0430 \u043e\u043d \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 PIN-\u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430. <\/strong>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0442\u0435\u0440\u044f\u043b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 email \u0438\u043b\u0438 SMS-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u0435\u0436\u0430.<\/strong> \u0412 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0430\u043d\u043a\u0438 \u0438\u043b\u0438 \u044d\u043c\u0438\u0442\u0435\u043d\u0442\u044b \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0445 \u043a\u0430\u0440\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u0443 \u043f\u043b\u0430\u0442\u0435\u043b\u044c\u0449\u0438\u043a\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 \u0446\u0435\u043b\u044f\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 push \u0438\u043b\u0438 SMS \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b MTS E\u0445olve, \u0442\u043e \u0436\u0434\u0435\u043c \u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<hr\/>\n<p><strong>\u0420.\u00a0S.<\/strong> \u0427\u0435\u0440\u0435\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u041c\u0422\u0421 Exolve \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438: \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0437\u0432\u043e\u043d\u043e\u043a, \u043a\u043e\u043b-\u0442\u0440\u0435\u043a\u0438\u043d\u0433, \u0437\u0430\u0449\u0438\u0442\u0443 \u043d\u043e\u043c\u0435\u0440\u0430, \u0432\u044b\u0431\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430, SMS-\u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0427\u0442\u043e \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u0440\u043e Exolve:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/717824\/\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u041c\u0422\u0421 Exolve? \u041e\u0431\u0437\u043e\u0440 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439<\/a> <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/793960\/\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u043e\u0432\u0430\u0440\u0430 \u043d\u0430 \u0441\u043a\u043b\u0430\u0434\u0435 <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/796921\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 WordPress-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 SMS-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/a><\/p>\n<\/li>\n<\/ul>\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\/829764\/\"> https:\/\/habr.com\/ru\/articles\/829764\/<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e SMS. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article&amp;utm_term=sms_api_exolve\">MTC Exolve<\/a> \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flask. \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043b\u0435\u0433\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043d\u0430\u043f\u0440\u044f\u0436\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0423\u0432\u044b, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438, \u043d\u043e \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0445\u043e\u0434 \u043f\u043e SMS<\/h3>\n<p>\u0427\u0430\u0441\u0442\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u0430\u0440\u0443 \u0438\u0437 \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u2014 \u0432\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 SMS-\u043a\u043e\u0434. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/758148\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0423\u0442\u043e\u0447\u043d\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0445\u0430\u043a\u0435\u0440\u0441\u043a\u0438\u0445 \u0438 \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u0442\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438. \u0426\u0435\u043b\u044c \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u0442\u0430\u043a \u2014 \u0437\u0430\u0432\u043b\u0430\u0434\u0435\u0442\u044c \u043b\u0438\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439: \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438, \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u043e\u043c\u0435\u0440\u0443 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 SMS \u0434\u043b\u044f \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430. \u041c\u044b \u0436\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u0440\u0435\u0434\u043a\u0438\u0445 \u0438 \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432 \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u044b \u0431\u0435\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u0445\u043e\u0434 \u043f\u043e \u043a\u043e\u0434\u0443 \u0438\u0437 SMS \u0443\u0434\u043e\u0431\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d, \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c SMS-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u043e\u043a\u0430\u0446\u0438\u0439. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u0440\u043e\u0437\u044b \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/exolve.ru\/products\/sms-api\/?utm_source=habr&amp;utm_medium=refferal&amp;utm_campaign=sms_api_article&amp;utm_content=article&amp;utm_term=sms_api_exolve\">SMS API<\/a> \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b MTC Exolve \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Flask. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e API-\u043a\u043b\u044e\u0447 \u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 SMS \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Flask\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/h3>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 Flask? \u041e\u043d \u043d\u0435\u043f\u043b\u043e\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e Python \u0438 \u043d\u0443\u0436\u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 SMS-\u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Flask-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Flask \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 requests: pip install Flask requests<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<pre><code class=\"css\">flasksms\/     \/venv     \/templates         signup.html         verify.html    start.html    result.html    error.html     app.py     config.py     dev.env<\/code><\/pre>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/h4>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>templates<\/code> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u044f\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><code>signup.html<\/code> \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><code>start.html<\/code> \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p><code>error.html<\/code> \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u0432\u043e\u0434\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><code>result.html<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><code>verify.html<\/code> \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e SMS-\u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c.\u00a0\u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0424\u0430\u0439\u043b <code>app.py<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 Flask-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 SMS-\u043a\u043e\u0434\u0430 \u0438 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c <code>generated_codes<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b <code>config.py<\/code>:<\/p>\n<pre><code class=\"css\">from dotenv import dotenv_values  info_env = dotenv_values('dev.env')  API_KEY = info_env.get('API_KEY') PHONE_SEND = info_env.get('PHONE_SEND')<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 <code>app.py<\/code>:<\/p>\n<pre><code class=\"css\">from flask import Flask, render_template, request, jsonify import requests import random import string from config import API_KEY, PHONE_SEND  app = Flask(__name__)   # \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f app.secret_key = API_KEY  # \u041d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 phone_send = PHONE_SEND   # \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 generated_codes = {}  @app.route('\/', methods=['GET'])  def start():   return render_template('start.html')<\/code><\/pre>\n<p>\u0421\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 html \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html lang=\"en\"> &lt;head> &lt;meta charset=\"UTF-8\"> &lt;title>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c&lt;\/title> &lt;style> body { background-color: white; font-family: Arial, sans-serif; text-align: center; } h3 { margin-top: 80px; } &lt;\/style> &lt;\/head> &lt;body> &lt;h3>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c&lt;\/h3> &lt;h5>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 flask \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0433\u043e SMS-\u043a\u043e\u0434\u0430&lt;\/h5> &lt;p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 &lt;a href=\"http:\/\/0.0.0.0:5000\/signup\">\u0437\u0434\u0435\u0441\u044c&lt;\/a>.&lt;\/p> &lt;p>--------------------------------------------------------------&lt;\/p> &lt;\/body> &lt;\/html> <\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <strong>\/singup<\/strong> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430:<\/p>\n<pre><code class=\"css\">@app.route('\/signup', methods=['GET', 'POST'])  def signup():  if request.method == 'POST': number = request.form['number']   # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 5 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0445 \u0431\u0443\u043a\u0432  code = ''.join(random.choice(string.ascii_letters) for _ in range(5))   # \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c SMS \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c  sms_data = { \"number\": phone_send, \"destination\": number, \"text\": code}  headers = {'Authorization': f'Bearer {API_KEY}'}  response = requests.post(url=\"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\", json=sms_data, headers=headers)  if response.status_code == 200:  # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438  generated_codes[number] = code  return render_template('verify.html', number=number)  else:  return f\"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS: {response.status_code}\"   return render_template('signup.html')<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e number \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437 \u0442\u0435\u0433\u0430 input \u0448\u0430\u0431\u043b\u043e\u043d\u0430 <code>signup.html<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>SMS Signup&lt;\/title> &lt;style> .container { width: 33.33%; margin: 0 auto; }        label { display: block; } input[type=\"text\"] { width: 70%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 10px; } button[type=\"submit\"] { background-color: #7FBB28; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; } button[type=\"submit\"]:hover { background-color: #7F\u0421B10; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"container\"> &lt;h1>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e SMS&lt;\/h1> &lt;form method=\"POST\" action=\"\/signup\"> &lt;label for=\"number\">\u041d\u043e\u043c\u0435\u0440 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e:&lt;\/label> &lt;input type=\"text\" name=\"number\" placeholder=\"+7 --- --- -- --\" required> &lt;button type=\"submit\">\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434&lt;\/button> &lt;\/form> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>requests.post(url=\"https:\/\/api.exolve.ru\/messaging\/v1\/SendSMS\", json=sms_data, headers=headers)<\/code> \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 SMS \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0432 \u0444\u043e\u0440\u043c\u0443. \u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 headers \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 API-\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 SMS \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d <code>verify.html<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043b\u044f \u0441\u0432\u0435\u0440\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0432\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"css\">@app.route('\/verify\/&lt;number>', methods=['GET', 'POST'])  def verify(number):  if request.method == 'POST':  entered_code = request.form['code']  if number in generated_codes and entered_code == generated_codes[number]:  pasport = ''.join(str(random.randint(0, 9)) for _ in range(10)) credit = ''.join(str(random.randint(0, 9)) for _ in range(16)) data = {\u201c\u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\u201d: credit, \u201c\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430\u201d: pasport} return render_template('result.html', data=data)   else:  return render_template('error.html')   return render_template('verify.html', number=number)<\/code><\/pre>\n<p>\u0420\u0430\u0437 \u043c\u044b \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 verify.html, \u0442\u043e \u0435\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u0438\u0436\u0435 \u0441\u0442\u0438\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e \u0432\u043a\u0443\u0441\u0443:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;title>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435&lt;\/title> &lt;style> .container { width: 33.33%; margin: 0 auto; } label { display: block; }  input[type=\"text\"] { width: 70%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 10px; }  button[type=\"submit\"] { background-color: #9eccc1; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }   button[type=\"submit\"]:hover { background-color: #9ec1cc; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"container\"> &lt;h1>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430&lt;\/h1> &lt;form method=\"POST\" action=\"\/verify\/{{ number }}\"> &lt;label for=\"code\">\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434:&lt;\/label> &lt;input type=\"text\" name=\"code\" required> &lt;button type=\"submit\">\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c&lt;\/button> &lt;\/form> &lt;\/div> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432 \u0442\u0435\u0433\u0435 input \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u0432\u043e\u0434 \u043a\u043e\u0434\u0430 \u0438 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 button \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <strong>\/verify\/&lt;number><\/strong>. \u0415\u0441\u043b\u0438 \u043a\u043e\u0434, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 generated_codes[number], \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043e\u0442\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d result.html, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043b\u0430\u0434\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430 \u0438 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043d\u0435\u043c. \u0422\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;style> table { border-collapse: collapse; margin: 0 auto; } th, td { padding: 10px; text-align: left; } th { background-color: #f2f2f2; border-radius: 10px 10px 0 0; } td { border-bottom: 1px solid #ddd; } &lt;\/style> &lt;\/head> &lt;body> &lt;table> &lt;tr> &lt;th>\u041d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430&lt;\/th> &lt;td>{{ data['\u043d\u043e\u043c\u0435\u0440 \u0441\u0447\u0435\u0442\u0430'] }}&lt;\/td> &lt;\/tr> &lt;tr> &lt;th>\u041d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430&lt;\/th> &lt;td>{{ data['\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430'] }}&lt;\/td> &lt;\/tr> &lt;\/table> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0434 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0432\u0435\u0440\u043d\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <code>error.html<\/code> \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head> &lt;style> body { text-align: center; font-family: Arial, sans-serif; } .message { margin-top: 100px; font-size: 24px; color: red; } .link { margin-top: 20px; font-size: 16px; text-decoration: none; } &lt;\/style> &lt;\/head> &lt;body> &lt;div class=\"message\">\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435, \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434.&lt;\/div> &lt;a class=\"link\" href=\"http:\/\/0.0.0.0:5000\/signup\">\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430&lt;\/a> &lt;\/body> &lt;\/html><\/code><\/pre>\n<h3>\u0412 \u043a\u0430\u043a\u0438\u0445 \u0435\u0449\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f OTP \u0447\u0435\u0440\u0435\u0437 SMS<\/h3>\n<ul>\n<li>\n<p><strong>\u0414\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/strong>, <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/755006\/\">\u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435<\/a>. \u041e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 SMS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/strong> \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-426595","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/426595","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=426595"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/426595\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}