Python Advanced Tutorial 7 - CGI Programming

preview_player
Показать описание
This is tutorial covering how to set up a basic web server on Ubuntu and use python for our server-side scripts. All Links and Slides will be in the description. Subscribe for more cool stuff!

If you like what you see be sure to subscribe and thumbs up!
Рекомендации по теме
Комментарии
Автор

Thank you very much for this video. I was searching for a way how my python script could talk and react with the users web browser. I was not aware of there is an CGI
module exists. I watched about 10 tutorial videos about this topic, but none of them answered my question. Then i stumbled upon yours, and finally found the solution immediately. So you saved my day!

joto
Автор

for apache 2.4 on ubuntu 16.04 lts u first need to enable a2enmod with:
sudo a2enmod cgi

Baazi
Автор

Nicely done.  I appreciate the detail you gave and the demonstration..

andrewdavis
Автор

Thanks dude i tried ubuntu 12 version and it worked

savetheplanetplease
Автор

I'm about to record a video on Database Interaction, And I'm working on a video about The Birthday Attack, as well as working on a video for Alternate Data Streams!

DrapsTV
Автор

Hey ! I am using Ubuntu 14.04 LTS . I installed Apache2,   in the sites-available directory there is only 000-default.conf and default-ssl.conf and 1 mycgi.conf. I explicitly made a default.conf and copied the contents you showed in the slide.
In the default 000-defafult.conf I changed the document room from /var/www/html to /var/www. But on typing 127.0.0.1 it says 404 PAGE NOT FOUND .
Also, when I am normally typing 127.0.0.1, it shows APACHE UBUNTU DEFAULT PAGE in which it has explained the configuration overview. I am just not able to proceed . Please help. Thanks

giteshchopra
Автор

Thx for clear explanation, this video is great!

rasulo
Автор

Thank you for this video.
Your explanation helped me a lot.

LeandroQuibemMagnabosco
Автор

TO NOTE!: CGI USES "getvalue()" not "getValue()". it does not like capital V.
At the beginning of your script ALSO do
import cgitb
cgitb.enable()

ISSUE I WAS HAVING. For some reason, this does not accept using ", " to seperate strings.... you gotta use "+".

islarf
Автор

sudo vim vim not found ?? erro vim what vim ??? help me

nope
Автор

After apache is installed, I have 000-default.conf not the default file
And the 000-default file is empty
What to do

vishakraj
Автор

My question after seeing this is if php does need a CGI kind of module in order to run by default? and other question would be: what if a wanted to run not just PHP, Python or Perl, What if I wanted to run C or C++?

Автор

how did you add automated syntax colouring to .cgi? I have to do it manually everytime

islarf
Автор

Hi. You stored the python file in var/www directory. Is it possible to store it in some other directory ad run the file in the browser?

swapnilbhaumik
Автор

Question:
Say that I have an index.html that contains a form element with a post method and an action assigned to a python script. When viewing the html, I would select, within the form, "bring me a random number". The python script would gather the form name and post data and run a simple function that would generate a random number. How can I return the random number generated to the html page instead of using python to print a line of html containing the random number. I.e, is there an form method that retrieves values from a python script (given that the html form submitted a particular post)?

jordanlee
Автор

Hallow, I have been working into my simple project doing the CGI using the same operating system as you and the same configuration but there is no output once I run my local server it says you can not access this server
Please help me

japhetmnyeta
Автор

I can only see default-ssl.conf and 000-default.conf 
Please help me i am new to python
There is no default file

savetheplanetplease
Автор

Me also using Ubuntu 14.04 LTS and having the same problem as GIRISH CHOPRA having. Please Help us..

MohdSadique
Автор

When i downloaded apt-get install apache2, and i try to run it, it gives me syntax errors i.e. "Config Variable${APACHE_LOCK_DIR} is not defined " and "syntax error on line 74 of /etc/apache2/apache2.conf: invalid Mutex directory in argument file:${APACHE_LOCK_DIR}"

anumsheraz
Автор

Can I create separate html file and then take data from it to the python file instead of doing html work in python. Is there any method for that.

pawandeepsingh