Flask not working with python

i need help to write if statement in a python flask app to check the variable that accept emailaddress in a route function

Hi, welcome to the forums!

Is there a link to a lesson that relates to your query?
Do you have any code to post that’s throwing an error? Please post your formatted code.

2 Likes

Hi welcome to the forums,

That’s a potentially open-ended question, can you be more specific? Do you just want to validate that it’s in valid email form (eg. name@domain.com)? Do you want to let a user register? Do you want to confirm that registration?

Try checking this link if it’s what you’re looking for: https://realpython.com/handling-email-confirmation-in-flask/

1 Like

https://mega.nz/file/m3JmATgL#5yS1T5uZXoNoijBQ-RTDfzZ0JEUl3J-KrcFU339Ij-U

please above is my source code, what am trying to do is to check the string passed into the variable in route i want only email address to pass and check the domain from the email address if is hotmail redirect to hotmail.html if gmail.com it should redirect to gmail.html and so on but for domain that does not carry a particular extension like office365 i will run request to get if is roundcube webmail like this webmail.(domain) then for owa (domain)/owa/auth/logon.aspx? if it return 200 then i know is owa and after the user have been redirected to the right page for his domain on form submit i want the mailer function to execute and capture the data send it through mail

please look at my templates folder you will understand better

please please someone put my on right track.

Hi,

  • The best bet with source code is to upload it to github (not many people are willing to download zip files from unknown people).

  • In terms of checking the domain of an email, and if you already have 2 known entities, you can split the string on @ and do a check like that. But for some reason I’m not sure that that is exactly what you want to do.

  • The last bit is also unclear. I get that you have a mailer function and some data to send. I don’t see where you need the user’s domain for (but again, that’s because I’m not understanding the question). Explaining this it might be easier for someone to help.

2 Likes

first of all thanks for your help so far i do not want to verify the email i just grabbed the domain using split on the string @ so i did is i created html file for major email like gmail,yahoo,hotmail and so on i want gmail user to be redirected to gmail.html in my template but not only for gmail both yahoo,naver,163,live, when you look my code on github you understand better.

https://github.com/aaronjames247513/flaskapp

Hi,

It seems your link doesn’t work? Is it private or public?