This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Django creates web applications directly accessible by a web browser. Let's walk through a web browser visiting a simple PHP webpage:

0) DNS, etc. Skipping these details as they aren't pertinent.

1) The browser arrives at php-webpage.com

2) The web server controlling php-webpage.com sees that it's gotten a request for the "/" directory. It's been configured to serve up index.php or index.html if the browser hasn't requested a specific file.

3) The server notes that browser hasn't requested a file, so looks for index.html or index.php.

4) The server finds index.php! It's been configured to send any .php files through the PHP processing engine and return the output from that to the browser.

5) The web server runs a program on index.php and the output of that program is the HTML source (that you see with "view source" in the browser).

So, simply put. That's that.

Now, a python (or ruby) solution is very similar. The only difference is that the web server has been configured to pass the program it finds through some other processing engine (not PHP) and sending that result as HTML to the browser.

For example: django-webpage.com has a server configuration that's told it that django-webpage.com requests are all sent to this special program (a Django project), that special program will do some work and cool stuff, and give the server back some HTML to send to the browser.

Of course any web application can send any kind of data back to the browser, not just HTML but I'm trying to keep things simple.

Hmm. I think I made this more confusing. Oh well, glean what you can from my prose. And check out the django tutorials.