How does it all work

34 views
Skip to first unread message

Nafiul Islam

unread,
Jun 10, 2013, 10:10:51 AM6/10/13
to django...@googlegroups.com
Hi!

I've been using django for a little bit, and I gotta say I love the framework. But here's the thing, I don't know how it works. How everything fits together. So, what I wanted to ask is how does it all work? Say you have a server, and you have Python installed on it. How would you go about making a simple hello world web page, without django?

I would be grateful to any link to a comprehensive resource, that shows you how to make a simple Hello World webpage, from how you install software that you need to writing pure python (without a framework) that can handle requests, and work with databases.

I guess, what I'm asking is how do you make a very very basic website using Python, from start to finish on a server?

Thomas Weholt

unread,
Jun 10, 2013, 10:25:15 AM6/10/13
to django...@googlegroups.com
I'd take a look at the standard python docs, especially the things about wsgi and httpserver, but this question is not django-specific so you might have better look asking in a more python-specific forum, like comp.lang.python ( https://groups.google.com/forum/?fromgroups#!forum/comp.lang.python )

There's a long way and lots of codelines from a basic "Hello world" webapp to a framework like django, but you'll learn alot by starting with the standard webrelated stuff in standard python.

Thomas


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

Nick Apostolakis

unread,
Jun 10, 2013, 4:16:24 PM6/10/13
to django...@googlegroups.com
On 10/06/2013 05:10 μμ, Nafiul Islam wrote:
> Hi!
> I would be grateful to any link to a comprehensive resource, that
> shows you how to make a simple Hello World webpage, from how you
> install software that you need to writing pure python (without a
> framework) that can handle requests, and work with databases.
>

Hello, you could take a look at the classic cgi concept. It is the base
on which all wsgi,fastcgi and the rest of the family stand.

You have the webserver who accepts a request, the web server passes the
request to a program (of any language) through an interface ( cgi,wsgi
etc) the program returns through the same interface a response, the
webserver returns the response to the world.

A simple idea with a lot of consequences...

--
--------------------------------------------------------------
Nick Apostolakis
e-mail: nick...@oncrete.gr
Web Site: http://nick.oncrete.gr
--------------------------------------------------------------

Russell Keith-Magee

unread,
Jun 10, 2013, 6:59:02 PM6/10/13
to django...@googlegroups.com
Hi Nafiul,

One place to start would be to read the WSGI specification. WSGI is the interface between your web server (say, Apache) and Python as a language. The WSGI spec - also known as PEP 333 - gives a brief overview before it gets into the fine details. However, one of the advantages of WSGI as an interface is that there aren't actually that many fine details anyway -- for such a significant specification, it's remarkably readable.

http://www.python.org/dev/peps/pep-0333/

This will show you the interaction between web server and code that a website developer would need to write; from there, it's a matter of looking at what tasks the website developer needs to do often, and finding abstractions and APIs to make that job easier. That's where Django, and it's libraries for URL routing, database interaction, form processing and so on comes in. If you try and write a non-trivial website to the "bare metal" of WSGI, you'll very quickly see what Django (or any other web framework, for that matter) is providing for you.

Yours,
Russ Magee %-)

--

Gamesbrainiac

unread,
Jun 11, 2013, 12:49:38 AM6/11/13
to django...@googlegroups.com
@Russell: Thanks. That is what I wanted since WSGI is what most people use these days. Thanks, I will have a look at that.


--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/VHvM1uOGmio/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Kind Regards,

Quazi Nafiul Islam

Gamesbrainiac

unread,
Jun 11, 2013, 12:50:57 AM6/11/13
to django...@googlegroups.com
@Eraldo: Thanks for the reply. I've read that part of the Django book, but it does little to explain how Django itself works, because it uses WSGI not CGI. After this excursion, I plan to see how Django handles connections and such, so I'll be diving into the Django libraries.

Thanks for this, I appreciate it.


On 11 June 2013 07:44, Eraldo Helal <era...@eraldo.org> wrote:
I think.. I found what you are looking for: http://www.djangobook.com/en/2.0/chapter01.html
Under the heading "The MVC Design Pattern"..
there is a nice example of a simple CGI script using python (no django).

Greetings from Linz (Austria)
Eraldo

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/VHvM1uOGmio/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages