Commit 9e289bb697b2e55f6b7681c40e827232ad0d15bb
1 parent
be50999f
Exists in
master
barrabrasil.py: corrigindo a rota do barra.js utilizando o config. README: adici…
…onado referencia a nova configura??o
Showing
2 changed files
with
11 additions
and
5 deletions
Show diff stats
LEIAME
app/barrabrasil.py
1 | 1 | from flask import Flask, url_for, render_template, request, Response, make_response |
2 | 2 | from config import Config |
3 | -import hashlib#,webbrowser | |
3 | +import hashlib | |
4 | 4 | |
5 | 5 | # Criar Key e certificado |
6 | 6 | # openssl genrsa 1024 > ssl.key |
... | ... | @@ -26,6 +26,9 @@ def pagina_teste(): |
26 | 26 | |
27 | 27 | @app.route('/barra.js') |
28 | 28 | def barra(): |
29 | + f = file('profile') | |
30 | + cfg = Config(f) | |
31 | + profile = cfg.profile | |
29 | 32 | with app.open_resource('templates/%s/barra-brasil.js' % profile) as f: |
30 | 33 | conteudo = f.read().decode('utf-8') |
31 | 34 | etag = hashlib.sha1(conteudo.encode('utf-8')).hexdigest() |
... | ... | @@ -40,10 +43,8 @@ def barra(): |
40 | 43 | return resposta |
41 | 44 | |
42 | 45 | if __name__ == '__main__': |
43 | - f = file('profile') | |
44 | - cfg = Config(f) | |
45 | - profile = cfg.profile | |
46 | - #webbrowser.open("http://127.0.0.1:5000/",new=2) | |
46 | + import webbrowser | |
47 | + webbrowser.open("http://127.0.0.1:5000/",new=2) | |
47 | 48 | app.run(debug=False) |
48 | 49 | #webbrowser.open("https://127.0.0.1:5000/",new=2) |
49 | 50 | #app.run(debug=False,ssl_context=ctx) | ... | ... |