<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">I have created a website with Flask that is serving a Bokeh app on a Digital Ocean VPN. Everything worked fine until I secured the server with Let's Encrypt following <a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;color:rgb(0,89,153);text-decoration-line:none">this tutorial</a>.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">In step 3 of the tutorial the Nginx configuration file is changed, which might be the crux of the problem I'm getting:</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">When I go on the website, the Flask content is rendered perfectly. However, the Bokeh app is not running. In the Inspection Console I get the following Error (note that I hashed out the IP address of my website):</p><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Mixed</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Content</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">The</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> page at </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'<a href="https://example.com/company_abc/">https://example.com/company_abc/</a>'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> was loaded over HTTPS</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
but requested an insecure script
</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'http://###.###.###.##:5006/company_abc/autoload.js?bokeh-autoload-element=f…aab19c633c95&bokeh-session-id=AvWhaYqOzsX0GZPOjTS5LX2M7Z6arzsBFBxCjb0Up2xP'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">This</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> request has been blocked</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> the content must be served over HTTPS</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">I understand that I might have to use a method called reverse proxying, which is described <a href="http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#reverse-proxying-with-nginx-and-ssl" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;color:rgb(0,89,153);text-decoration-line:none">here</a>. However, I wasn't able to get it to work.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Does anybody have an idea how to solve this? A similar problem was described <a href="http://stackoverflow.com/questions/38081389/bokeh-server-reverse-proxying-with-nginx-gives-404/38505205#38505205" style="margin:0px;padding:0px;border:0px;color:rgb(0,89,153);text-decoration-line:none">here</a>.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Here are my modified server files:</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">'/etc/nginx/sites-available/default':</p><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">upstream flask_siti </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
server </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">127.0</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.1</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">8118</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> fail_timeout</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
server </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
listen </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">443</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> ssl</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
server_name example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com www</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_certificate </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">etc</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">letsencrypt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">live</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">fullchain</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">pem</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_certificate_key </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">etc</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">letsencrypt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">live</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">privkey</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">pem</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_protocols </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">TLSv1</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">TLSv1</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">TLSv1</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">2</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_prefer_server_ciphers on</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_dhparam </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">etc</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">ssl</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">certs</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">dhparam</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">pem</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_ciphers </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_session_timeout </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1d</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_session_cache shared</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">SSL</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">50m</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_stapling on</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ssl_stapling_verify on</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
add_header </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Strict</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Transport</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Security</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> max</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">age</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">15768000</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
charset utf</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">8</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
client_max_body_size </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">75M</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
access_log </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">var</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">log</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nginx</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">access</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">log</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
error_log </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">var</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">log</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nginx</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">error</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">log</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
keepalive_timeout </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">5</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
location </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147)"># checks for static file, if not found proxy to the app</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
try_files $uri </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@proxy_to_app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
location </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@proxy_to_app</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
proxy_redirect off</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
proxy_set_header </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Host</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> $http_host</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
proxy_set_header X</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Forwarded</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">For</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> $proxy_add_x_forwarded_for</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
proxy_pass http</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">://</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask_siti</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
server </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
listen </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">80</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
server_name example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com www</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">301</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> https</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">://</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">$host$request_uri</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span></code></pre>'/etc/supervisor/conf.d/bokeh_serve.conf':<div><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">program</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bokeh_serve</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
command</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">opt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">envs</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">virtual</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bokeh serve company_abc</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">py company_xyz</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">py </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">--</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">allow</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">websocket</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">origin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">www</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">--</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">allow</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">websocket</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">origin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">example</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">com </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">--</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">host</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=###.###.###.##:</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">5006</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">--</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">use</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">xheaders
directory</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">opt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">webapps</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask_telemetry
autostart</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">false
autorestart</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">true
startretries</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">3</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
user</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nobody</span></code></pre>'/etc/supervisor/conf.d/flask.conf':</div><div><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">program</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
command</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">opt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">envs</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">virtual</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">gunicorn </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">b </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">8118</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> website_app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app
directory</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">opt</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">webapps</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">flask_telemetry
user</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nobody
autostart</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">true
autorestart</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">true
redirect_stderr</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">true</span></code></pre>And here is my Flask app (Note that I hashed out security related info):</div><div><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Flask</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask_sqlalchemy </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">SQLAlchemy</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> render_template</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> request</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> redirect</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> url_for
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask_security </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Security</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">SQLAlchemyUserDatastore</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">UserMixin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">RoleMixin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> login_required</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> roles_accepted</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> current_user
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask_security</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">decorators </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> anonymous_user_required
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> flask_security</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">forms </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">LoginForm</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> bokeh</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">embed </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> autoload_server
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> bokeh</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">client </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> pull_session
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> wtforms </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">StringField</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> wtforms</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">validators </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">InputRequired</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">from</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> werkzeug</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">contrib</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">fixers </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ProxyFix</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Flask</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">__name__</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SQLALCHEMY_DATABASE_URI'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'postgresql://###:###@localhost/telemetry'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SECRET_KEY'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'###'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SECURITY_REGISTERABLE'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SQLALCHEMY_TRACK_MODIFICATIONS'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">False</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SECURITY_USER_IDENTITY_ATTRIBUTES'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'username'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">config</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'SECURITY_POST_LOGIN_VIEW'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'/re_direct'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">debug </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
db </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">SQLAlchemy</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147)"># Define models</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
roles_users </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Table</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'roles_users'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'user_id'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Integer</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ForeignKey</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'<a href="http://user.id">user.id</a>'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'role_id'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Integer</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ForeignKey</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'<a href="http://role.id">role.id</a>'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Role</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Model</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">RoleMixin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
id </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Integer</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> primary_key</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
name </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">String</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">80</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> unique</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
description </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">String</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">255</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">User</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Model</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">UserMixin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
id </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Integer</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> primary_key</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
username </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">String</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">255</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> unique</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">True</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
password </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">String</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">255</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
active </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Boolean</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">())</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
confirmed_at </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Column</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">DateTime</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">())</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
roles </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">relationship</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'Role'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> secondary</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">roles_users</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
backref</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">backref</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'users'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> lazy</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'dynamic'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ExtendedLoginForm</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">LoginForm</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
email </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">StringField</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'Username'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">InputRequired</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">()])</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147)"># Setup Flask-Security</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
user_datastore </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">SQLAlchemyUserDatastore</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">db</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">User</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Role</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
security </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Security</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> user_datastore</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> login_form</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ExtendedLoginForm</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-com" style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147)"># Views</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">route</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'/'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@anonymous_user_required</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> index</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">():</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> render_template</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'index.html'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">route</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'/re_direct/'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@login_required</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> re_direct</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">():</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
identifier </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> current_user</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">username
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">print</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">identifier</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> redirect</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url_for</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">identifier</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">route</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'/index/'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@login_required</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@roles_accepted</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'admin'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> admin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">():</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> render_template</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'admin.html'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">route</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_abc/"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@login_required</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@roles_accepted</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'company_abc'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'admin'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> company_abc</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">():</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'http://###.###.###.##:5006'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">pull_session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app_path</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_abc"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">autoload_server</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">None</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app_path</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_abc"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">session_id</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">id</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> render_template</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"company_abc.html"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">route</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_xyz/"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@login_required</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">@roles_accepted</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'company_xyz'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'admin'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> company_xyz</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">():</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'http://###.###.###.##:5006'</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">pull_session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app_path</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_xyz"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">autoload_server</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">None</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app_path</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"/company_xyz"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">session_id</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">session</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">id</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">url</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> render_template</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"company_xyz.html"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bokeh_script</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">wsgi_app </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ProxyFix</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">wsgi_app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">if</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> __name__ </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">==</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'__main__'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
app</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">run</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">()</span></code></pre></div></div>