I need to create a simple website, the server is gonna running on Amazon EC2 web service. But I haven’t done web development before. It seems like I need to learn a lot of stuff, javascript, html, css, web framework, WSGI, apache web server, etc. And I am confused by some stuff that seems much the same.
So first question, Can anyone tell me what exactly do I need to set the website up. Is a web framework the only thing I need on the server side?
2th question, I am gonna use python on server side, there are really a bunch of web frameworks for python. What’s the difference between apache http server and the built-in wsgi or http web servers in those web frameworks.
3th question, Is WSGI the best choice? Most web frameworks support WSGI, does it mean WSGI is built in the web frameworks? Or I need to include mod_wsgi or something alike.
Also, according to this benchmark of python WSGI servers, gevent and mod_wsgi show great performance with low memory footprint. They don’t claim themselves as web frameworks, what’s the difference between them and the web frameworks like cherrypy, web2py.
Thanks
Depends on your website – if you only need static content, you can use static site generators (Blogofile, Hyde to name a few written in Python) or, if your website serves dynamic content, you should use some kind of framework (Flask, Django, etc). With static site generators all you need on the server is the webserver that serves your content, but with dynamic sites you might need extra libraries for various things like database support, caching, etc.
The built-in webservers are usually meant for local development and are generally not suitable for production use. For latter use the specific apps like mod_wsgi (for Apache) or uwsgi (for Nginx) instead. But try to avoid mod_python!
WSGI stands for Web Server Gateway Interface and is a standard protocol used between web server and web application (or framework). WSGI seems to be currently the only standard choice, so go with it.
As said before, WSGI is just a way that web server talks with web application. CherryPy and web2py deal with templating, request and session handling and output this information via WSGI to the web server.
And if you worry about the speed, then don’t worry about it too much.. 🙂