예제 #1
0
def signup():
    print 'request.args: ', request.args

    signup_form = HackNewsUserForm(request.form)
    error = None

    if request.method == "POST":
        print 'posted: ', request.method
        if signup_form.validate_on_submit():

            user = User(signup_form.name.data, signup_form.password.data,
                        signup_form.email.data)

            db.session.add(user)
            db.session.commit()

            flash('Logged in successfully.')
            login_user(user)

            print 'request.args: ', request.args
            print 'session: ', session
            print "request.args.get('next'): ", request.args.get('next')
            print "user: "******"signup.html", signup_form=signup_form, error=error)
예제 #2
0
def signup():

    print 'signup'
    print 'request.args', request.args

    error = None
    signup_form = HackNewsUserForm(request.form)
    if request.method == "POST":
        print 'poster'
        if signup_form.validate_on_submit():



            print "was valid"

            user = User(signup_form.name.data,
                        signup_form.password.data,
                        signup_form.email.data)

            login_user(user)
            flash('Logged in successfully.')

            print 'request.args', request.args
            print session

            print request.args.get('next')

            print user, 'user'

            print 'signup form attrs', (signup_form.name.data,
                                        signup_form.password.data,
                                        signup_form.email.data)
            db.session.add(user)
            db.session.commit()

            return redirect(url_for('hello_again'))
        else:
             print error

    return render_template("signup.html", signup_form=signup_form, error=error)
예제 #3
0
def signup():

    print 'signup'
    print 'request.args', request.args

    error = None
    signup_form = HackNewsUserForm(request.form)
    if request.method == "POST":
        print 'poster'
        if signup_form.validate_on_submit():

            print "was valid"

            user = User(signup_form.name.data, signup_form.password.data,
                        signup_form.email.data)

            login_user(user)
            flash('Logged in successfully.')

            print 'request.args', request.args
            print session

            print request.args.get('next')

            print user, 'user'

            print 'signup form attrs', (signup_form.name.data,
                                        signup_form.password.data,
                                        signup_form.email.data)
            db.session.add(user)
            db.session.commit()

            return redirect(url_for('hello_again'))
        else:
            print error

    return render_template("signup.html", signup_form=signup_form, error=error)