Python-CGI-WebApp

About

Python-CGI-WebApp is a simple web application that uses Python 3 scripts to generate dynamic webpages.

A CGI (Common Gateway Interface) enabled HTTP server (written in Python 3) handles these requests.

CGI (Common Gateway Interface)

The Common Gateway Interface offers a standard protocol for web servers to execute programs that execute like Console applications running on a server that generates web pages dynamically.

CGI Architecture

Working

There are three Python Scripts that work together to generate the HTML webpage

Content type: text/html \n\n

Prerequisites and Deployment

This WebApp requires Python3. Get Python3 from here

https://www.python.org/

0. Downloading the Project

Clone the project from here

https://github.com/shashank9830/Python-CGI-WebApp

1. Running the WebApp

  1. After cloning the project open terminal and change directory to webapp/
$ cd webapp

Start the HTTP Server with following command

$ python simple_httpd.py

You should see the following output on terminal

Server started on port 8080

This means the server is ready to take requests

DON’T CLOSE THIS TERMINAL

  1. Open your web browser and type localhost:8080

You should see the following output on terminal

Request Webpage content

  1. On the browser you should see this webpage

Home Page

  1. Click on the WebApp link and you should see successfull execution message in terminal

Python Script Executed

  1. A new dynamic webpage will be generated like this

WebApp Result

2. Shutting down the web server

To stop the web server simply close the terminal or press [Ctrl + C] in the terminal

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details