default .db its just a admin account with password password123
This commit is contained in:
@@ -55,7 +55,7 @@ def handle_submission():
|
|||||||
form_password = request.form.get('password') or ''
|
form_password = request.form.get('password') or ''
|
||||||
|
|
||||||
if not form_username or not form_email or not form_password:
|
if not form_username or not form_email or not form_password:
|
||||||
return render_template('signup.html', error="All fields are required"), 400
|
return render_template('signup.html', error="All fields must be entered to complete registration"), 400
|
||||||
|
|
||||||
if len(form_password) < 8:
|
if len(form_password) < 8:
|
||||||
return render_template('signup.html', error="Password must be at least 8 characters"), 400
|
return render_template('signup.html', error="Password must be at least 8 characters"), 400
|
||||||
@@ -63,7 +63,7 @@ def handle_submission():
|
|||||||
if User.query.filter_by(username=form_username).first():
|
if User.query.filter_by(username=form_username).first():
|
||||||
return render_template('signup.html', user_taken="Username has already been taken"), 400
|
return render_template('signup.html', user_taken="Username has already been taken"), 400
|
||||||
if User.query.filter_by(email=form_email).first():
|
if User.query.filter_by(email=form_email).first():
|
||||||
return render_template('signup.html', email_taken="Email has already been used"), 400
|
return render_template('signup.html', email_taken="Email has already been used before"), 400
|
||||||
|
|
||||||
hashed_password = generate_password_hash(form_password)
|
hashed_password = generate_password_hash(form_password)
|
||||||
new_user = User(username=form_username, email=form_email, password_hash=hashed_password)
|
new_user = User(username=form_username, email=form_email, password_hash=hashed_password)
|
||||||
@@ -73,7 +73,7 @@ def handle_submission():
|
|||||||
db.session.commit()
|
db.session.commit()
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
db.session.rollback()
|
db.session.rollback()
|
||||||
return render_template('signup.html', error="Username or email already taken"), 400
|
return render_template('signup.html', error="Username or email has already taken"), 400
|
||||||
|
|
||||||
return render_template('signup.html', success_message="Account successfully created")
|
return render_template('signup.html', success_message="Account successfully created")
|
||||||
|
|
||||||
@@ -161,6 +161,10 @@ def logout():
|
|||||||
def signup():
|
def signup():
|
||||||
return render_template('signup.html')
|
return render_template('signup.html')
|
||||||
|
|
||||||
|
@app.route('/pagemaker')
|
||||||
|
def pagemaker():
|
||||||
|
return render_template('pagemaker.html')
|
||||||
|
|
||||||
@app.route('/all_users')
|
@app.route('/all_users')
|
||||||
@login_required
|
@login_required
|
||||||
def all_users():
|
def all_users():
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>About this website</h1>
|
<h1>About this website</h1>
|
||||||
|
|
||||||
|
<p>This website is about different subjects in Maths and resources for them.</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block content %}
|
||||||
|
<h1>Where all the things required for making a page</h1>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user