", 400
+ if User.query.filter_by(email=form_email).first():
+ return "
Email already registered!
", 400
+
+ # 2. Hash the password into a secure scramble
+ hashed_password = generate_password_hash(form_password)
+
+ # 3. Save the user with the scrambled hash
+ new_user = User(username=form_username, email=form_email, password_hash=hashed_password)
+ db.session.add(new_user)
+ db.session.commit()
+
+ return redirect(url_for('success'))
+
+@app.route('/success')
+def success():
+ return "
Data successfully saved to the database!
"
+
+@app.route('/users')
+def view_users():
+ # Fetch all user records from the database
+ all_users = User.query.all()
+
+ # Create a simple HTML table to display them nicely
+ html_output = "
Registered Accounts
"
+ html_output += "
ID
Username
Email
"
+
+ for user in all_users:
+ html_output += f"
{user.id}
{user.username}
{user.email}
{user.password_hash}
"
+
+ html_output += "
"
+
+ # If the database is completely empty
+ if not all_users:
+ return "
-
\ No newline at end of file
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..6de1853
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+ {% block title %}Math Website{% endblock %}
+
+
+
+
+
+ {% block content %}{% endblock %}
+
+
+
\ No newline at end of file
diff --git a/bivariate.html b/templates/bivariate.html
similarity index 94%
rename from bivariate.html
rename to templates/bivariate.html
index 1ab6742..011c10b 100644
--- a/bivariate.html
+++ b/templates/bivariate.html
@@ -1,5 +1,8 @@
-
-
+{% extends 'base.html' %}
+
+{% block content %}
+
+
@@ -32,4 +35,8 @@
-
\ No newline at end of file
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..a05a401
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+{% block content %}
+
+
+
+
homepage for math website wow
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/signin.html b/templates/signin.html
new file mode 100644
index 0000000..ec9094b
--- /dev/null
+++ b/templates/signin.html
@@ -0,0 +1,13 @@
+{% extends 'base.html' %}
+
+{% block content %}
+
+
+
+
+
+
+
Sign in page with sql database
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/signup.html b/templates/signup.html
new file mode 100644
index 0000000..909a6c0
--- /dev/null
+++ b/templates/signup.html
@@ -0,0 +1,25 @@
+{% extends 'base.html' %}
+
+{% block content %}
+
+
+
+
+
+
+
Sign up page with sql database
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/test.html b/templates/test.html
similarity index 100%
rename from test.html
rename to templates/test.html