Tutorial :python web programming [closed]


I started learning Python through some books and online tutorials. I understand the basic syntax and operations, but I realize that the correct way to understand the language would be to actually do a project on it.

Now when i say a project, I mean something useful, maybe some web app. I started searching for web programming in python and landed on a couple of tutorials referencing a very complex code. most of it was based upon, i think, CGI programming.

now what i would really appreciate is if someone could provide certain guidelines on how a beginner like me can understand the various aspects of programming the web through python. because the things i am seeing are just confusing me. can anyone please help?


If you want to create a powerful web application with Python, Django is the way to go. You can start with the documentation at http://docs.djangoproject.com/en/dev/ or the Django Book (I recommend the latter). It's a bit complicated to grasp as a beginner, but it's totally worth the hassle :)

Good Luck!


+1 for django, though the "django book" is a little simpler to understand (especially if you're just getting start with python): http://www.djangobook.com/en/2.0/


Start with the Django tutorial here http://docs.djangoproject.com/en/dev/intro/tutorial01/ and work your way to the end, then go back and read the rest of the Django documentation.


Google App Engine uses python and runs on Google's infrastructure: http://code.google.com/appengine/

They have many tutorials and examples that can help you get started.


You can read substantial parts of "Python in a Nutshell" for free online -- though selective pages are being omitted at the publisher's request to induce you to buy the book -- and other only partly-overlapping parts of the second edition here. The chapters I'm pointing you to in both the first and second editions are about sockets and server-side network programming, the immediately previous ones cover network and web programming with a focus on the client sides, and following ones cover CGI and alternatives, HTML, XML, etc.

Not covered, due to the age of the books, is the best alternative to CGI, WSGI (can actually be deployed on top of CGI, but also very efficiently on Apache, nginx, Google App Engine, etc; and basically all modern Python web frameworks run well on top of WSGI -- there are also some highly modular "not quite frameworks" such as werkzeug that are totally WSGI-focused).

To deliver a working Python web app ASAP, Django is probably the best and definitely the most popular choice today; but the very aspects that make it such a high-productivity environment (the huge amount of things it does "hiddenly and magically" on your behalf) make it less useful for pure learning purposes than more modular, less abstract, less magical frameworks such as Paste, Pylons, Werkzeug, &c. It's very instructive to start on plain WSGI and add helpful components and middleware only gradually as you understand why they're better than doing it all yourself "by hand".

For more info on WSGI, see its own site which is rich with helpful links & docs.


Start by writing really simple network application.

Try starting with a small program that listens on a port, and gives some status message when questioned. For example, when a web browser calls it, It would display the time and some facts about the system.

That would tech you the basics, and you'll find your route from there on.


Begin with Making a simple web server in Python. If you want to learn some theoretical background, try the legendary Beej's Guide to Network Programming. The examples are in C, but it'll get you through terms like socket, bind, port and listen.

If you're unhappy with the tutorial I have given above, Just Google "Python server" or "Python network tutorial" and you'll find lots of them.


There are many web frameworks for Python.

The most popular is Django, but don't believe the people here that it is "the only way" or similar. They simply haven't used any other.

Look around to see what you want, read the tutorials to see what makes sense to you. And if you can't make up your mind, then go for Django. :-)


If you start with Appengine (Django, webapp, DIY with WebOb, Pylons -- whatever) then if you get an application written, no matter how stupid or trivial, you can deploy it and it'll keep working and you can share it with people. The whole deploy-and-keep-working task is largely unrelated to programming or Python, but it's also a lot of work. By skipping that you can focus on the programming and have the motivation of making real deployed applications.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »