Begin building contact form

This commit is contained in:
2025-01-08 19:57:42 +00:00
parent 781be0bab1
commit 856528fbc4
3 changed files with 34 additions and 0 deletions

17
src/contact.py Normal file
View File

@@ -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')

View File

@@ -5,6 +5,7 @@ from flask import Flask, render_template, Response
app = Flask(__name__)
import projects
import contact
@app.route('/')
def index():

View File

@@ -0,0 +1,16 @@
{% include 'header.html' %}
<main>
<h2>Contact Me</h2>
<p>Got a question or want to talk about something on this site? Drop me a message below:</p>
<form action="#" method="post">
<label for="name">Name:</label>
<input type="text" name="name">
<label for="email">Email Address:</label>
<input type="email" name="email">
<label for="message">Message:</label>
<textarea name="message"></textarea>
<input type="submit" name="submit" value="Submit">
</form>
</main>
{% include 'footer.html' %}