It seems that the most important concept in Python web development is the least 
explained and hardest to understand (which makes it very hard for anyone that 
wants to learn Python for web development).  I wonder if you all might be able 
to help me understand it.
I posted a thread about it here:
http://python-forum.org/py/viewtopic.php?t=3310
I'll also include the post here:
I have looked at a lot of stuff related to web programming in Python, including 
the various frameworks like Pylons. However, I am still completely lost as to 
how the whole website development on Python works.

With PHP, the concept is relatively simple to understand:
1. You install a web server like Apache.
2. You install PHP, which basically outputs text files that are then served to 
the web by Apache.
3. The logic of how they interact is rather simple too:
3a. Apache sends the GET or POST request to the PHP file and PHP has built-in 
methods for reading the GET or POST data.
3b. PHP then outputs text, which Apache serves up to the web for all to see.

Simple, and easy 'eh? But, I simply do not understand the concept of how Python 
web development works.

*. Reading around, I see that there are different methods for handling URL 
requests, which implies that things work at a much lower level (and in a much 
more complex way) than what I understand.
*. There are many web development frameworks, but I am simply not sure what 
they are for. In PHP, you can use the frameworks to more easily code PHP files 
to put on your server; however, in the end the PHP concept is still the basic 
and simple one described earlier. On the other hand, with the Python frameworks 
it almost seems like they do more, as some include a web server and stuff like 
ways to handle URLs. I am not sure what to make of this or what it all means.

*. As I understand it, Python is not anything like PHP in that it does not 
embed code into HTML, but works differently? How do you code html pages then? 
Or do you code things differently? Do you need to use some kind of template 
language? If so, how do you know which one to pick? How do you use them and how 
do they fit into what appears to be an increasingly complex design for website 
programming?

Taking a look at Pylons, I see several things:
"Models" - referring to databases
"Templating"
"AJAX"
"Request Dispatching"

Ajax is not key to web programming (since it's client side javascript), so I 
don't even have to ask about that. You can just as easily download and install 
ajax libraries on your own or use them on static html pages.
Models (in reference to databases) appears to just refer to the various 
database abstraction libraries. Again, this is not part of the basic concept of 
web development, though it is very important to have when making sites. From 
SQLAlchemy's site, actually using such an abstraction library to access 
databases appears very easy and straightforward. It appears that you can do 
this in any Python app, and is thus not unique to web development.

So, we are left with:
"Templating"
"Request Dispatching"
and I would like to add:
Server

What is "Templating"?
What is "Request Dispatching"?
How do these fit into the simple web development design I gave earlier? Are 
they key components, or optional stuff like Ajax and DB Abstraction?

It seems the key parts that I am trying to understand are least explained? 
Basically it is this?
*. How do you setup a webserver for Python web development (I am talking about 
a robust, high capacity, high user system like the Apache/PHP setup I described 
earlier -- in other words, one that you would use for a high profile website; 
not some test server)?
*. How do you create webpages in Python -- specifically the processing of 
GET,POST,COOKIES, and then the displaying of HTML, XML, etc...? Do you have to 
use the CGI method, as opposed to PHP's mixing of HTML and code? Are there are 
streamlined and better ways of doing this? I forsee Python's use of whitespace 
to be a problem in PHP like coding. Does creating webpages mean I have to use 
some kind of library to make it easier. If so, what are these libraries? Are 
they the templating languages? How do you know which one to choose?

* What is this "Request Dispatching" that I hear about? Does Python web 
development not handle file names in the same way as PHP or Perl? Can you 
explain?

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to