Forums

How do I make a dynamic web page using python.

I've created a python file which prints a random number. I than uploaded it to /var/www, but when I goto the site it asks me to download the file instead of running it. How do I get it to display the random number?

You're thinking of a cgi server. That's very insecure so people are moving away from it. You will have to do some reading on one of the python web frameworks (eg: flask, django etc) in order to host dynamic webpages.

Thanks, I've gotten my page to work.