-it can easily generate html from a script (using some templating system makes this really easy), using databases and all the other nice things python offers
-it can be called from a web server as response to a user clicking on a web form in a browser (this is the cgi method you mention), and easily interpret the information in the provided fields
-it can generate javascript to be inserted/included in your web pages (see for example pyjamas)
-it can implement a simple web server for local debugging/testing purposes on your own pc.
-etc.
Web frame works like django combine the mentioned functionality in a single system for easier use.
To get a more to the point answer you will have to explain in a little more detail what you are trying to achieve.
As you mentioned, the CGI (Comon Gateway Interface) permit to communicate with the user using HTML forms. I don't think you really need JS for this (It can help to make a clearer interface and load directly result without refreshing the page, but not essential).
As it might help some people here, I'll show you how to do a simple interface.
The first point you have to understand, is that your python script will "print" the HTML page (when you open a python's script from the navigator, it'll execute the script and read the "return" as html code). You have to add an additional line so your navigator will translate the return as html:
print "Content-Type : text/html \n\n"
So, a script like test.py will display a formatted html page.
The second point is html form and the "cgi" module of python. If you are not really comfortable with html form, you should follow some tutorial on the internet (there is a lot). If you know html forms, then you should now the "post" method which permit to refresh the page or open a new one with some additional information about the user entry. That's were the "cgi" module of python is important. It permit to get these information in python variable.
You have to first "import cgi" which comes with python and then use the fieldStorage function. You can get user entry with the getvalue("widget_name"). As it's not really clear, I added a python script "cgi_scipt.py" that show you how it works.
Then, you'll be able to make some cool stuff like the link below.
If you want to connect python with django , there are many frameworks to do that. As far as I can understand , you are talking in context of web applications. Out of available frameworks I would recommend Django which is based on MVC framework.