How to connect Python and HTML in a web application

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
Hi guys,
i have written a python script that generates a random mathematical question which will be used as a captcha system e.g signing up for a email address and it asks you to prove your human and not a bot. In my case i want to create a simple web page using HTML which will have a Username and Password for the user to type and username and password in . It will also have a click button called "Sign In" , i want this button to link to my python script as i want a random mathematical question to pop up to the user every time they click the "sign in" button.

here is my HTML page:

upload_2019-4-26_21-45-14.png

i want the "sign in" button to link to my python script to generate the random mathematical question after the user clicks it:
upload_2019-4-26_21-48-1.png

here is my python script:

upload_2019-4-26_21-53-27.png
 

Attachments

jpanhalt

Joined Jan 18, 2008
8,331
Are you trying to discourage people from signing up and thereby reduce revenue? That does not sound like a good business model. What are you trying to accomplish?

I have seen simple captcha math questions, e.g., how much is 2+3. However, the ones that ask for traffic signs are often bewildering. Is a stop and go light a traffic "sign?" Usually, if/when I fail one, I move on.

Basically, what value do you intend to add? Can you give an example? Are spammers who can't add 2+3 a real problem?

BTW, Welcome to AAC. Would you be here if there had been a difficult captcha that you had to try 3 times to get registered?
 

WBahn

Joined Mar 31, 2012
24,973
It's highly debatable how good any of the captcha systems are. There are services where you simply have your bot take the captcha and send it to them, they then display the captcha on a porn site where a human has to solve it in order to get a picture, then the result is sent back.
 

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
It's highly debatable how good any of the captcha systems are. There are services where you simply have your bot take the captcha and send it to them, they then display the captcha on a porn site where a human has to solve it in order to get a picture, then the result is sent back.
Are you trying to discourage people from signing up and thereby reduce revenue? That does not sound like a good business model. What are you trying to accomplish?

I have seen simple captcha math questions, e.g., how much is 2+3. However, the ones that ask for traffic signs are often bewildering. Is a stop and go light a traffic "sign?" Usually, if/when I fail one, I move on.

Basically, what value do you intend to add? Can you give an example? Are spammers who can't add 2+3 a real problem?

BTW, Welcome to AAC. Would you be here if there had been a difficult captcha that you had to try 3 times to get registered?
The screenshot of my sign in page is not what my final page will look like its just a sign in page that doesnt do anything its just for the user to type any Username and Password and once they click sign in it will generate a captcha which is a random maths question from my python code e.g. 456 + 345 + 122. The user gets 3 chances once they attempt the 3rd chance and get it wrong they will see a No authorisation message but that message is also in python code
 

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
It's highly debatable how good any of the captcha systems are. There are services where you simply have your bot take the captcha and send it to them, they then display the captcha on a porn site where a human has to solve it in order to get a picture, then the result is sent back.
I can only use HTML to create my web based application . I heard flask can connect python and HTML together but it looks so advanced and complicated . I only got 2 more days to complete this pls help me
 

jpanhalt

Joined Jan 18, 2008
8,331
The screenshot of my sign in page is not what my final page will look like its just a sign in page that doesnt do anything its just for the user to type any Username and Password and once they click sign in it will generate a captcha which is a random maths question from my python code e.g. 456 + 345 + 122. The user gets 3 chances once they attempt the 3rd chance and get it wrong they will see a No authorisation message but that message is also in python code
From a computer's perspective, what's the difference between 456+345+122 and 12+13 (except the number of 8-bit bytes needed)? In other words, if the computer can do character recognition, the number of digits really doesn't matter much. On the other hand, it does matter to a human answering the question.

Which gets back to answering what is the proper balance between making a hurdle and building a wall that will discourage customers/products? What are the deficiencies of the current system and how will your system address them?

Are you asking for advice or advertising?
 

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
From a computer's perspective, what's the difference between 456+345+122 and 12+13 (except the number of 8-bit bytes needed)? In other words, if the computer can do character recognition, the number of digits really doesn't matter much. On the other hand, it does matter to a human answering the question.

Which gets back to answering what is the proper balance between making a hurdle and building a wall that will discourage customers/products? What are the deficiencies of the current system and how will your system address them?

Are you asking for advice or advertising?
Advice on how i connect my python code to HTML
 

jpanhalt

Joined Jan 18, 2008
8,331
Unfortunately, I am pretty ignorant about web stuff. There are members here who are knowledgeable and will pitch in. Give it a day or so.

If you click "edit" you may be able to edit the title to reflect your need to connect python to HTML. That might help.

There are some limits on what you can do based on number of posts. If you are not able to edit it yourself, one of the moderators can help. To reach a moderator, you can just post a response asking for help here or open a "conversation" (i.e., PM). Our moderators are quite responsive to such requests.

John
 
Last edited:

eetech00

Joined Jun 8, 2013
1,738
It's highly debatable how good any of the captcha systems are. There are services where you simply have your bot take the captcha and send it to them, they then display the captcha on a porn site where a human has to solve it in order to get a picture, then the result is sent back.
Yes...its not perfect...but it does prevent a lot of automated password hacking.

eT
 

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
Unfortunately, I am pretty ignorant about web stuff. There are members here who are knowledgeable and will pitch in. Give it a day or so.

If you click "edit" you may be able to edit the title to reflect your need to connect python to HTML. That might help.

There are some limits on what you can do based on number of posts. If you are not able to edit it yourself, one of the moderators can help. To reach a moderator, you can just post a response asking for help here or open a "conversation" (i.e., PM). Our moderators are quite responsive to such requests.

John
Theres no edit button available, im confused how to contact the moderators , is there an option “post response”?
 

WBahn

Joined Mar 31, 2012
24,973
The best way to get the mods' attention is to Report a post. Normally this is used for reporting violations, but self-reporting a post to make a request is certainly allowable. In this case you might report your original post and then in the dialog that pops up just ask that the thread title be changed to such-and-such. Of course, no need to now since I've seen your posts.

What do you want the title of the thread to be?
 

Thread Starter

Edward Kombo

Joined Apr 26, 2019
9
The best way to get the mods' attention is to Report a post. Normally this is used for reporting violations, but self-reporting a post to make a request is certainly allowable. In this case you might report your original post and then in the dialog that pops up just ask that the thread title be changed to such-and-such. Of course, no need to now since I've seen your posts.

What do you want the title of the thread to be?
Oh alright thank you, i would like to change it to connect python to HTML web based application
 

wayneh

Joined Sep 9, 2010
16,128
You need to write the code in a language that the server understands. This will depend on who is hosting your site. I can't imagine a modern server host not offering php and I agree with the suggestion to use it. Confirm first with your hosting service, though. I don't think Python is meant for this sort of duty and I have no idea how widely it is supported, if at all.
 
Top