diff --git a/src/contact.py b/src/contact.py new file mode 100644 index 0000000..18294c4 --- /dev/null +++ b/src/contact.py @@ -0,0 +1,17 @@ +#!/usr/bin/python3 + +from index import app +from os import environ +from flask import request, redirect, render_template + + + +@app.route('/contact/', methods=('GET', 'POST')) +def contact(): + if request.method == 'POST': + discord_hook = environ['DISCORD_WEBHOOK'] + print(discord_hook) + print(request.form) + return redirect('/contact/') + else: + return render_template('contact.html') diff --git a/src/index.py b/src/index.py index 7efbddc..51a84c8 100644 --- a/src/index.py +++ b/src/index.py @@ -5,6 +5,7 @@ from flask import Flask, render_template, Response app = Flask(__name__) import projects +import contact @app.route('/') def index(): diff --git a/src/templates/contact.html b/src/templates/contact.html new file mode 100644 index 0000000..5ff4f4f --- /dev/null +++ b/src/templates/contact.html @@ -0,0 +1,16 @@ +{% include 'header.html' %} +
+

Contact Me

+

Got a question or want to talk about something on this site? Drop me a message below:

+ +
+ + + + + + + +
+
+{% include 'footer.html' %} \ No newline at end of file