-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
46 lines (31 loc) · 1.02 KB
/
server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from flask import Flask
from flask import render_template, request, redirect, url_for, g
import py_compile
app = Flask(__name__)
# Routes:
@app.route('/')
@app.route('/index')
def index():
file = open("static/python/last_post_caption.txt", "r")
if file.mode == "r":
instagram_text = repr(file.read())
instagram_text = instagram_text.replace('\\n.\\n', ' <br> ')
instagram_text = instagram_text.replace('\\n', ' <br> ')
instagram_text = instagram_text.replace("'", '')
return render_template("index.html", instagram_text=instagram_text)
file.close()
return render_template("index.html")
@app.route('/telematica')
def telematica():
return render_template("telematica.html")
@app.route('/nosotros')
def nosotros():
return render_template("nosotros.html")
@app.route('/contacto')
def contacto():
return render_template("contacto.html")
@app.errorhandler(404)
def page_not_found(error):
return render_template('index.html')
if __name__ == '__main__':
app.run()