Monday 15 June 2015

Python Flask Mailchimp signup -


I have a PostMonkey & amp; Receive an email address flask from HTTP (from my website) and then subscribe to that specific list.

This works and sends an email requesting the user to confirm the subscription, but server error 500

type error: signup () no arguments

This is my code:

  @ app.route ("/ signup", methods = ['GET'] ]) Def signup (): Try: email = request.args.get ('email') subscribe to pm.list (id = "Cdc2ba625c", email_address = email) Except MailChimpException, e: Print e.code Print e . Terror Return Redirect ("/") Return Signup   

I'm not sure what is happening because of this and it's going to annoy me for some time!

The statement, the flask turned out likes to not return anything. Try: email = request .form ['email'] # email = request.

  @ app.route ('/ signup', methods = ['POST']) Def signup (): try Args.get ('email') subscribe to pm.list (id = "cdc2ba625c", email_address = email, double_optin = False) except MailChimpException, e: print e.code print e. Terror Return Redirect ("/")   

Thanks for all those who commented back

No comments:

Post a Comment