Python web programming

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

Now, when I talk about the project, I mean something useful, maybe some kind of web application. I started searching for web programming in python and landed on several tutorials linking to very complex code. most of them were based, in my opinion, on CGI programming.

Now, what I would really appreciate is if someone can give specific recommendations on how a newbie, like me, can understand various aspects of programming the Internet through python. because the things that I see are just confusing for me. can anyone help?

+6
python web-applications
source share
8 answers

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 little hard to understand as a beginner, but it's totally worth the hassle :)

Good luck

+4
source share

+1 for django, although the "django book" is a little easier to understand (especially if you are just starting out with python): http://www.djangobook.com/en/2.0/

+6
source share

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

+2
source share

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

They have many guides and examples to help you get started.

+2
source share

Start by writing a really simple network application.

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

This will teach you the basics and you will find your route from there.

EDIT:

Start by creating a simple web server in Python . If you want to learn the theoretical background, try the legendary Beej Guide to Network Programming . Examples are given in C, but you will get through terms such as socket, binding, port, and listening.

If you are unhappy with the tutorial I gave above, just google the "Python server" or the "Python Network Tutorial" and you will find a lot of them.

+2
source share

You can read the essential parts of Python in a Nutshell for free online — although select pages are omitted at the publisher’s request to encourage you to buy the book — and the other only partially overlapping parts of the second edition are here . The chapters that I point out to you in both the first and second editions deal with sockets and network programming on the server side, they immediately cover network and web programming with an emphasis on the client side, and the next ones on CGI and alternatives, HTML, XML, etc.

Not covered, due to the age of books, is the best alternative to CGI, WSGI (can actually be deployed on top of CGI, but also works very efficiently with Apache, nginx, Google App Engine, etc.) and basically all modern web frameworks Python works well on top of WSGI - there are also very modular "not really frameworks" like werkzeug, which are fully WSGI-oriented).

To deliver a working Python ASAP web application, Django is probably the best and by far the most popular choice today; but the very aspects that make it such a high-performance environment (the sheer number of things that it does “secretly and magically” on your behalf) make it less useful for pure learning purposes than the more modular, less abstract, less magical framework, such as Paste, Pylons, Werkzeug, & c. It is very instructive to start with a simple WSGI and add useful components and middleware only gradually, since you understand why they are better than doing everything yourself "manually."

For more information about WSGI, see its own site , which is rich in useful links and documents.

+2
source share

There are many web frameworks for Python.

The most popular Django, but do not believe people here that this is the "only way" or the like. They simply did not use anything else.

See what you want, read the tutorials to find out what makes sense to you. And if you can't decide, go to Django. :-)

0
source share

If you start with Appengine (Django, webapp, DIY using WebOb , Pylons - regardless), then if you get a written application, no matter how stupid or trivial, you can deploy it and it will continue to work, and you will can share it with people. All of the deployment and maintenance work is largely unrelated to programming or Python, but it is also a lot of work. By skipping this, you can focus on programming and have the motivation to create real deployed applications.

0
source share

All Articles