-
Notifications
You must be signed in to change notification settings - Fork 0
/
Portfolio.py
42 lines (32 loc) · 1.01 KB
/
Portfolio.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
from flask import Flask, render_template, request, redirect, url_for
import requests
import socket as s
import os
app = Flask(__name__)
host = s.gethostname()
@app.route('/')
def my_site():
return render_template('index.html')
@app.route('/send_email', methods=['POST'])
def send_email():
name = request.form['name']
email = request.form['email']
subj = request.form['subject']
msg = request.form['message']
response = requests.post(
os.environ.get('MAILGUN_LINK'),
auth=("api", os.environ.get('API_KEY')),
data={"from": 'Name: ' + name + ' Email: ' + email,
"to": "Francisco Burgos <dabo021213@gmail.com>",
"subject": subj,
"text": msg})
return redirect('/', code=301)
# @app.route('/video_chat')
# def video_chat():
# return render_template('video_chat.html')
@app.route('/video_chat')
def video_chat():
return render_template('chat.html')
if __name__ == '__main__':
if 'liveconsole' not in host:
app.run()