Created
March 11, 2014 16:29
-
-
Save rdegges/9489384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/register', methods=['GET', 'POST']) | |
def register(): | |
""" | |
This view allows a user to register for the site. | |
""" | |
if request.method == 'GET': | |
return render_template('register.html') | |
try: | |
user = User( | |
email = request.form.get('email'), | |
password = request.form.get('password'), | |
) | |
except: | |
return render_template('register.html', error='Username and password required.') | |
return redirect(url_for('dashboard')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment