How to create simple web site with python? How to create simple web site with python? python python

How to create simple web site with python?


I was hoping more elaborate answers would be given to this question, since it's a sensitive subject. Python web developing is split across lots of frameworks, each with its ups and downs and every developer using a different one. This is quite unfortunate. What you should know:

  • Use WSGI. Don't use anything else, WSGI is the latest standard in Python web developing;
  • Don't develop directly on top of WSGI, unless you really have to (not even for a hello world app);
  • Use a framework that best suits your needs:
    • I played with Werkzeug (which is not really a platform, they call it a toolkit) because it's really simple yet powerful. It lets you work on the WSGI level (also helps you understand how WSGI works) while providing really useful features and helpers. On the Werkzeug website you will also find useful tutorials and things like that.
    • Probably the most popular framework is Django. Never used it, but maybe there's a reason for why it is so popular.

In conclusion, use whatever is closest to your heart.


You can write a web site with Python in which the web server is implemented in Python, or in which Python is called from some other web server. If you do not already have a web server set up, the first option is easier. The Python library includes a fully functional web server, all you have to is add a couple of methods to respond to requests.

For a complete example of a web site using this simple technique, see Making a simple web server in Python

This technique may or may not serve you well for developing commercial, production web sites, but it's the simplest way from P(ython) to W(ebsite).


Why don't you try out the Google AppEngine stuff? They give you a local environment (that runs on your local system) for developing the application. They have nice, easy intro material for getting the site up and running - your "hello, world" example will be trivial to implement.

From there on, you can either go with some other framework (using what you have learnt, as the vanilla AppEngine stuff is pretty standard for simple python web frameworks) or carry on with the other stuff Google provides (like hosting your app for you...)