{"id":223375,"date":"2014-05-19T22:49:02","date_gmt":"2014-05-19T18:49:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=223375"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=223375","title":{"rendered":"<span class=\"post_title\">\u041c\u0435\u0433\u0430-\u0423\u0447\u0435\u0431\u043d\u0438\u043a Flask, \u0427\u0430\u0441\u0442\u044c 6: \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u042d\u0442\u043e \u0448\u0435\u0441\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0441\u0435\u0440\u0438\u0438, \u0433\u0434\u0435 \u044f \u0431\u0443\u0434\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flask.<\/p>\n<p>  \u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u043c\u0438\u043a\u0440\u043e\u0431\u043b\u043e\u0433, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0437\u0430 \u043f\u043e\u043b\u043d\u044b\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0437\u0432\u0430\u0442\u044c microblog.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"http:\/\/habrahabr.ru\/post\/193242\/\">\u0427\u0430\u0441\u0442\u044c 1: \u041f\u0440\u0438\u0432\u0435\u0442, \u041c\u0438\u0440!<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/193260\/\">\u0427\u0430\u0441\u0442\u044c 2: \u0428\u0430\u0431\u043b\u043e\u043d\u044b<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/194062\/\">\u0427\u0430\u0441\u0442\u044c 3: \u0424\u043e\u0440\u043c\u044b<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/196810\/\">\u0427\u0430\u0441\u0442\u044c 4: \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/222983\/\">\u0427\u0430\u0441\u0442\u044c 5: \u0412\u0445\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 <\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 6: \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0430\u0432\u0430\u0442\u0430\u0440\u044b (\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f)<br \/>  \u0427\u0430\u0441\u0442\u044c 7: Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 8: \u041f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u0438 \u0434\u0440\u0443\u0437\u044c\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 9: \u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 10: \u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<br \/>  \u0427\u0430\u0441\u0442\u044c 11: \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 e-mail<br \/>  \u0427\u0430\u0441\u0442\u044c 12: \u0420\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 13: \u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 14: I18n and L10n<br \/>  \u0427\u0430\u0441\u0442\u044c 15: Ajax<br \/>  \u0427\u0430\u0441\u0442\u044c 16: \u041e\u0442\u043b\u0430\u0434\u043a\u0430, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 17: \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Linux (\u0434\u0430\u0436\u0435 \u043d\u0430 Raspberry Pi!)<br \/>  \u0427\u0430\u0441\u0442\u044c 18: \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Heroku Cloud  <\/div>\n<\/div>\n<h5>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f OpenID.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0421\u043f\u0435\u0440\u0432\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0438 \u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430\u0445, \u0442\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f.<\/h5>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 <i>HTML<\/i>-\u0448\u0430\u0431\u043b\u043e\u043d \u043a \u043d\u0435\u0439.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. (\u0444\u0430\u0439\u043b <i>app.views.py<\/i>):<\/p>\n<pre><code class=\"python\">@app.route('\/user\/&lt;nickname&gt;') @login_required def user(nickname):     user = User.query.filter_by(nickname = nickname).first()     if user == None:         flash('User ' + nickname + ' not found.')         return redirect(url_for('index'))     posts = [         { 'author': user, 'body': 'Test post #1' },         { 'author': user, 'body': 'Test post #2' }     ]     return render_template('user.html',         user = user,         posts = posts) <\/code><\/pre>\n<p>  \u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <i>app.route<\/i> \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0435\u0445 \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438.<br \/>  \u041c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <i>nickname<\/i>. \u0422\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u043e \u0432\u044c\u044e-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0442\u0435\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c. \u041a\u043e\u0433\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 <i>URL \/user\/miguel <\/i>, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>nickname = &#8216;miguel&#8217;<\/i>.<\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0439\u0442\u0438 \u0431\u0435\u0437 \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432. \u0421\u043f\u0435\u0440\u0432\u0430 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <i>nickname<\/i> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435.<\/p>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <i>render_template<\/i>, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c. \u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0435 <i>author<\/i>.<\/p>\n<p>  \u041d\u0430\u0448 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e (\u0444\u0430\u0439\u043b <i>app\/templates\/user.html<\/i>):<\/p>\n<pre><code class=\"django\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;h1&gt;User: {{user.nickname}}!&lt;\/h1&gt; &lt;hr&gt; {% for post in posts %} &lt;p&gt;   {{post.author.nickname}} says: &lt;b&gt;{{post.body}}&lt;\/b&gt; &lt;\/p&gt; {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u041c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043d\u043e \u043d\u0430 \u043d\u0435\u0451 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438. \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 (\u0444\u0430\u0439\u043b <i>app\/templates\/base.html<\/i> ):<\/p>\n<pre><code class=\"html\">    &lt;div&gt;Microblog:         &lt;a href=&quot;{{ url_for('index') }}&quot;&gt;Home&lt;\/a&gt;         {% if g.user.is_authenticated() %}         | &lt;a href=&quot;{{ url_for('user', nickname = g.user.nickname) }}&quot;&gt;Your Profile&lt;\/a&gt;         | &lt;a href=&quot;{{ url_for('logout') }}&quot;&gt;Logout&lt;\/a&gt;         {% endif %}     &lt;\/div&gt; <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>url_for <\/i>\u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>nickname<\/i>.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041d\u0430\u0436\u0430\u0432 \u043d\u0430 <i>You Profile<\/i> \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 URL \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 <code>http:\/\/localhost:5000\/user\/miguel<\/code> \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <i>Miguel<\/i>.<\/p>\n<h5>\u0410\u0432\u0430\u0442\u0430\u0440\u043a\u0438.<\/h5>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u044b\u043b\u044b\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443, \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432 \u043a\u043b\u0430\u0441\u0441 (<i>app\/models.py<\/i>)<\/p>\n<pre><code class=\"python\">from hashlib import md5 # ... class User(db.Model):     # ...     def avatar(self, size):         return 'http:\/\/www.gravatar.com\/avatar\/' + md5(self.email).hexdigest() + '?d=mm&s=' + str(size) <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <i>avatar <\/i>\u0432\u0435\u0440\u043d\u0451\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0438, \u0441\u0436\u0430\u0442\u043e\u0439 \u0434\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  <i>Gravatar <\/i>\u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e. \u0412\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c MD5-\u0445\u044d\u0448 \u043e\u0442 \u0435\u043c\u0435\u0439\u043b\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <i>URL<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043b\u0435 \u0445\u044d\u0448\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <i>URL<\/i> \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. <i>d=mm <\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 <i>Gravatar <\/i>\u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>mm <\/i> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0441\u0435\u0440\u044b\u043c \u0441\u0438\u043b\u0443\u044d\u0442\u043e\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>s = N<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u043e \u043a\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443.<\/p>\n<p>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f <a href=\"https:\/\/ru.gravatar.com\/site\/implement\/images\">Gravatar<\/a>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043b\u0430\u0441\u0441 User \u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f (\u0444\u0430\u0439\u043b app\/templates\/user.html):<\/p>\n<pre><code class=\"python\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{user.avatar(128)}}&quot;&gt;&lt;\/td&gt;         &lt;td&gt;&lt;h1&gt;User: {{user.nickname}}&lt;\/h1&gt;&lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; &lt;hr&gt; {% for post in posts %} &lt;p&gt;   {{post.author.nickname}} says: &lt;b&gt;{{post.body}}&lt;\/b&gt; &lt;\/p&gt; {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 <i>User <\/i>\u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0447\u0442\u043e <i>Gravatar <\/i>\u043d\u0435 \u0442\u043e \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <i>avatar<\/i>, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c (\u0434\u0430\u0436\u0435 \u0442\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435), \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<br \/>  \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443 \u0432 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043d\u043e \u0432 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0440\u044f\u0434\u043e\u043c \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u043e \u043f\u043e\u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0443\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u043e\u0435 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<br \/>  \u0414\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0430 \u043c\u044b \u0432\u043d\u0435\u0441\u0451\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d (\u0444\u0430\u0439\u043b <i>app\/templates\/user.html<\/i>):<\/p>\n<pre><code class=\"django\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{user.avatar(128)}}&quot;&gt;&lt;\/td&gt;         &lt;td&gt;&lt;h1&gt;User: {{user.nickname}}&lt;\/h1&gt;&lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; &lt;hr&gt; {% for post in posts %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{post.author.avatar(50)}}&quot;&gt;&lt;\/td&gt;&lt;td&gt;&lt;i&gt;{{post.author.nickname}} says:&lt;\/i&gt;&lt;br&gt;{{post.body}}&lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/db7\/167\/972\/db71679724b935c209406cf32e73c7d7.png\" alt=\"image\"\/><\/p>\n<h5>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 ( sub-template)<\/h5>\n<p>  \u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041d\u0430\u0448\u0430 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043d\u043e \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438. \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\/\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u0435\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0441\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0437\u0430\u0439\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0432\u0441\u0435\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043c\u0435\u044e\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u044f, \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d \u0442\u0430\u043a \u0433\u0434\u0435 \u043e\u043d \u043d\u0443\u0436\u0435\u043d (\u0444\u0430\u0439\u043b \/app\/templates\/post.html):<\/p>\n<pre><code class=\"html\">&lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{post.author.avatar(50)}}&quot;&gt;&lt;\/td&gt;&lt;td&gt;&lt;i&gt;{{post.author.nickname}} says:&lt;\/i&gt;&lt;br&gt;{{post.body}}&lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; <\/code><\/pre>\n<p>  \u0414\u043b \u043d\u0430\u0447\u0430\u043b\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u0442\u044c, \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u0411\u0435\u0440\u0451\u043c <i>HTML<\/i>-\u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430.<\/p>\n<p>  \u041f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <i>Jinja2<\/i> \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <i>include<\/i> (\u0444\u0430\u0439\u043b <i>app\/templates\/user.html<\/i>):<\/p>\n<pre><code class=\"django\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{user.avatar(128)}}&quot;&gt;&lt;\/td&gt;         &lt;td&gt;&lt;h1&gt;User: {{user.nickname}}&lt;\/h1&gt;&lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; &lt;hr&gt; {% for post in posts %}     {% include 'post.html' %} {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0441\u044b\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0434\u0448\u0430\u0431\u043b\u043e\u043d, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u044b.<\/p>\n<h5>\u0411\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438<\/h5>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043b\u044e\u0431\u044f\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0435\u0431\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u0430\u0434\u0438\u043c \u0438\u043c \u044d\u0442\u0443 \u0432\u043e\u0437\u043d\u043e\u0436\u043e\u0441\u0442\u044c, \u0438 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f. \u0415\u0449\u0451 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0430\u0439 \u0441\u0430\u0439\u0442 \u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f.<\/p>\n<p>  \u0427\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0435, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <i>User<\/i> (\u0444\u0430\u0439\u043b app\/models.py):<\/p>\n<pre><code class=\"python\">class User(db.Model):     id = db.Column(db.Integer, primary_key = True)     nickname = db.Column(db.String(64), unique = True)     email = db.Column(db.String(120), index = True, unique = True)     role = db.Column(db.SmallInteger, default = ROLE_USER)     posts = db.relationship('Post', backref = 'author', lazy = 'dynamic')     about_me = db.Column(db.String(140))     last_seen = db.Column(db.DateTime) <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e. \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043a\u0430\u043a \u0432 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0443\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0411\u0414. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0436\u0438\u043d\u0430\u0435\u043c \u043f\u043b\u043e\u0434\u044b \u044d\u0442\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u043d\u0430\u0448\u0443 \u0411\u0414, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439:<\/p>\n<blockquote><p>.\/db_migrate.py  <\/p><\/blockquote>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:  <\/p>\n<blockquote><p>New migration saved as db_repository\/versions\/003_migration.py<br \/>  Current database version: 3<\/p><\/blockquote>\n<p>  \u0418 \u043d\u0430\u0448\u0438 \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0411\u0414. \u041d\u0435 \u0437\u0430\u0431\u044b\u043b\u0438, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430 Windows \u0442\u043e \u043f\u0443\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0430\u0437\u043d\u044b\u0435.<br \/>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0411\u0414 \u0432 \u0440\u0443\u0447\u043d\u0443\u044e, \u0438\u043b\u0438 \u0445\u0443\u0436\u0435 \u0442\u043e\u0433\u043e, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0451 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 (\u0444\u0430\u0439\u043b <i>app\/templates\/user.html<\/i>):<\/p>\n<pre><code class=\"django\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{user.avatar(128)}}&quot;&gt;&lt;\/td&gt;         &lt;td&gt;             &lt;h1&gt;User: {{user.nickname}}&lt;\/h1&gt;             {% if user.about_me %}&lt;p&gt;{{user.about_me}}&lt;\/p&gt;{% endif %}             {% if user.last_seen %}&lt;p&gt;&lt;i&gt;Last seen on: {{user.last_seen}}&lt;\/i&gt;&lt;\/p&gt;{% endif %}         &lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; &lt;hr&gt; {% for post in posts %}     {% include 'post.html' %} {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <i>Jijna2<\/i> \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u043e\u043b\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u043e\u043b\u0435 <i>Last_seen<\/i> \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/222983\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435<\/a> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <i>before_request<\/i>. \u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0445\u043e\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0444\u0430\u0439\u043b <i>app\/views.py<\/i>):<\/p>\n<pre><code class=\"python\">from datetime import datetime # ... @app.before_request def before_request():     g.user = current_user     if g.user.is_authenticated():         g.user.last_seen = datetime.utcnow()         db.session.add(g.user)         db.session.commit() <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043e\u0439\u0434\u0451\u0442\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u0437\u0430\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 breforerequest, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432 \u0411\u0414.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0447\u0430\u0441\u043e\u0432\u043e\u043c \u043f\u043e\u044f\u0441\u0435 <i>UTC<\/i>. \u041c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u044d\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438 \u0432 <i>UTC<\/i>, \u0447\u0442\u043e \u0431\u044b \u043e\u043d\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443. \u0415\u0441\u0442\u044c \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0442\u043e \u0436\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 <i>UTC<\/i>. \u041c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0433\u043b\u0430\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043a\u0430\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e, \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043f\u043e\u043b\u044f \u00ab\u043e\u0431\u043e \u043c\u043d\u0435\u00bb, \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0439 \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044f.<\/p>\n<h5>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f.<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0435\u0433\u043a\u043e. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u044b (\u0444\u0430\u0439\u043b <i>app\/forms.py<\/i>)<\/p>\n<pre><code class=\"python\">from flask.ext.wtf import Form from wtforms import TextField, BooleanField, TextAreaField from wtforms.validators import Required, Length  class EditForm(Form):     nickname = TextField('nickname', validators = [Required()])     about_me = TextAreaField('about_me', validators = [Length(min = 0, max = 140)]) <\/code><\/pre>\n<p>  \u0418 \u0448\u0430\u0431\u043b\u043e\u043d (\u0444\u0430\u0439\u043b <i>app\/templates\/edit.html<\/i>):<\/p>\n<pre><code class=\"python\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;h1&gt;Edit Your Profile&lt;\/h1&gt; &lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;edit&quot;&gt;     {{form.hidden_tag()}}     &lt;table&gt;         &lt;tr&gt;             &lt;td&gt;Your nickname:&lt;\/td&gt;             &lt;td&gt;{{form.nickname(size = 24)}}&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;About yourself:&lt;\/td&gt;             &lt;td&gt;{{form.about_me(cols = 32, rows = 4)}}&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;\/td&gt;             &lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;Save Changes&quot;&gt;&lt;\/td&gt;         &lt;\/tr&gt;     &lt;\/table&gt; &lt;\/form&gt; {% endblock %} <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (\u0444\u0430\u0439\u043b <i>app\/views.py<\/i>):<\/p>\n<pre><code class=\"python\">from forms import LoginForm, EditForm  @app.route('\/edit', methods = ['GET', 'POST']) @login_required def edit():     form = EditForm()     if form.validate_on_submit():         g.user.nickname = form.nickname.data         g.user.about_me = form.about_me.data         db.session.add(g.user)         db.session.commit()         flash('Your changes have been saved.')         return redirect(url_for('edit'))     else:         form.nickname.data = g.user.nickname         form.about_me.data = g.user.about_me     return render_template('edit.html',         form = form) <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0447\u0442\u043e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0444\u0430\u0439\u043b <i>app\/templates\/user.html<\/i>):<\/p>\n<pre><code class=\"python\">&lt;!-- extend base layout --&gt; {% extends &quot;base.html&quot; %}  {% block content %} &lt;table&gt;     &lt;tr valign=&quot;top&quot;&gt;         &lt;td&gt;&lt;img src=&quot;{{user.avatar(128)}}&quot;&gt;&lt;\/td&gt;         &lt;td&gt;             &lt;h1&gt;User: {{user.nickname}}&lt;\/h1&gt;             {% if user.about_me %}&lt;p&gt;{{user.about_me}}&lt;\/p&gt;{% endif %}             {% if user.last_seen %}&lt;p&gt;&lt;i&gt;Last seen on: {{user.last_seen}}&lt;\/i&gt;&lt;\/p&gt;{% endif %}             {% if user.id == g.user.id %}&lt;p&gt;&lt;a href=&quot;{{url_for('edit')}}&quot;&gt;Edit&lt;\/a&gt;&lt;\/p&gt;{% endif %}         &lt;\/td&gt;     &lt;\/tr&gt; &lt;\/table&gt; &lt;hr&gt; {% for post in posts %}     {% include 'post.html' %} {% endfor %} {% endblock %} <\/code><\/pre>\n<p>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u0447\u0442\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0441\u044f \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u043d\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0447\u0443\u0436\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043e \u0441\u0435\u0431\u0435.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/532\/4c9\/1b6\/5324c91b661b79609e9cfd761dc99e4f.png\" alt=\"image\"\/><\/p>\n<h5>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u2026 \u0438 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435!<\/h5>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438?<br \/>  \u041d\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0435\u0451 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<p>  \u0421\u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0451 \u043d\u0430\u0439\u0442\u0438?<\/p>\n<p>  \u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430. \u041c\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e. \u0418 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0442\u0443 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0451 \u043d\u0430\u0439\u0442\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0451\u0442\u0435, \u0442\u043e \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u042f \u043e\u0431\u044c\u044f\u0441\u043d\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u043a\u0430\u043a \u0435\u0451 \u0438\u0441\u043f\u0440\u0430\u0432\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u042f \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u0440\u0445\u0438\u0432. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u044b, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 \u0435\u0451 \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 db_upgrade.py. \u041d\u0443 \u0430 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043b\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e db_create.py.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u043c\u043e\u0439 \u0443\u0447\u0435\u0431\u043d\u0438\u043a.<br \/>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0430\u0441 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0435. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/223375\/\"> http:\/\/habrahabr.ru\/post\/223375\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u042d\u0442\u043e \u0448\u0435\u0441\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0441\u0435\u0440\u0438\u0438, \u0433\u0434\u0435 \u044f \u0431\u0443\u0434\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flask.<\/p>\n<p>  \u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u043c\u0438\u043a\u0440\u043e\u0431\u043b\u043e\u0433, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0437\u0430 \u043f\u043e\u043b\u043d\u044b\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0437\u0432\u0430\u0442\u044c microblog.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"http:\/\/habrahabr.ru\/post\/193242\/\">\u0427\u0430\u0441\u0442\u044c 1: \u041f\u0440\u0438\u0432\u0435\u0442, \u041c\u0438\u0440!<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/193260\/\">\u0427\u0430\u0441\u0442\u044c 2: \u0428\u0430\u0431\u043b\u043e\u043d\u044b<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/194062\/\">\u0427\u0430\u0441\u0442\u044c 3: \u0424\u043e\u0440\u043c\u044b<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/196810\/\">\u0427\u0430\u0441\u0442\u044c 4: \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/222983\/\">\u0427\u0430\u0441\u0442\u044c 5: \u0412\u0445\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 <\/a><br \/>  \u0427\u0430\u0441\u0442\u044c 6: \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0430\u0432\u0430\u0442\u0430\u0440\u044b (\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f)<br \/>  \u0427\u0430\u0441\u0442\u044c 7: Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 8: \u041f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u0438 \u0434\u0440\u0443\u0437\u044c\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 9: \u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 10: \u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<br \/>  \u0427\u0430\u0441\u0442\u044c 11: \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 e-mail<br \/>  \u0427\u0430\u0441\u0442\u044c 12: \u0420\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 13: \u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 14: I18n and L10n<br \/>  \u0427\u0430\u0441\u0442\u044c 15: Ajax<br \/>  \u0427\u0430\u0441\u0442\u044c 16: \u041e\u0442\u043b\u0430\u0434\u043a\u0430, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 17: \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Linux (\u0434\u0430\u0436\u0435 \u043d\u0430 Raspberry Pi!)<br \/>  \u0427\u0430\u0441\u0442\u044c 18: \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Heroku Cloud  <\/div>\n<\/div>\n<h5>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f OpenID.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0421\u043f\u0435\u0440\u0432\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0438 \u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430\u0445, \u0442\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0430\u0442\u0430\u0440\u043a\u0443. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/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-223375","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223375","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=223375"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223375\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}