dimanche 30 août 2015

Setting up a server to execute a Python Script

I am looking to create a very basic website that has a single feature. This feature works as follows:

  • 1) The user inputs a URL to a website
  • 2) My website will scrape the given website for necessary information
  • 3) Apply whatever logic I need and return the processed information as a string
  • 4) Allow user to download returned data in .txt format.

I am working on this project with one collaborator, and he has created the scraping and logic (steps 2 and 3) in Python. I have looked around stack overflow to see if it is possible to execute python scripts in a website, and the consensus seemed to be that I will require a server that executes python, and then make HTTP requests to my server.

Unfortunately, I'm quite a junior developer and lack a lot of understanding regarding web dev, and my attempts to "dive in" have left me with more questions than answers. We have a deadline that is approximately 3 days from now, and the only part that remains is to set up a server that can execute a specific python script upon HTTP requests.

I think that the source of my confusion is a lack of understanding regarding how exactly a server works, and was hoping that the kind folks here at stack overflow could help me in:

1) better understanding what's going on "under the hood" on the server side after an HTTP request arrives (or better yet, how does an HTTP request even arrive at all?)

2) Explain to me like I'm 5 what I'll need to do to deploy my website - namely all the in-between steps that receive little attention from the other posts here at stack overflow.

Some example questions that run through my head are below:

What type of server will I need?

How will I know if it can run Python?

How does the server know that I want to execute a certain script, while upon a user entering a my website's homepage URL, land at the home screen?

I've also read up on "middle layers" such as 'CGI' - what does this accomplish?

Is setting up a server reinventing the wheel? enter code here Is there already a service out there that does what I'm looking for?




Aucun commentaire:

Enregistrer un commentaire