Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

I have decent knowledge of php, i.e., I can take a framework, read its code and if the docs are adequate, understand what its doing. Main reason for that is that php is actually a very easy language which is literally made for web-dev.
I have been trying to learn django for a week now, can knock up a basic app with it, but there are just too many things which go over my head, i.e, look like magic, reason for that , i think is that the whole interaction with the server thing is part of django, which is all handled by your server in php, I want to read more about this part, i.e. what all topics should i cover to 'get' this. please suggest some books too

share|improve this question

migrated from stackoverflow.com Jun 14 '11 at 6:35

This question came from our site for professional and enthusiast programmers.

marked as duplicate by gnat, Glenn Nelson, Jalayn, GlenH7, Ryathal Apr 30 '13 at 21:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

have u tried to get the source code from Django and read it?! –  Arthur Neves Jun 13 '11 at 21:17
djangobook.com Would be the best book out there IMO. –  TomHarrigan Jun 13 '11 at 21:24
Do you know how to code Python? It's a bit different from PHP and Django makes heavy use of its flexible and extensible class system in a way that is likely to seem like magic to someone unfamiliar with the Python object model. Without being more specific about what you're having trouble with, it's going to be difficult to answer questions. –  OlduvaiHand Jun 13 '11 at 21:24
Django source code is not good reading for a Python beginner. Metaclasses, which are the core of the Model system, require much more knowledge of Python than using Django does. –  Mike DeSimone Jun 13 '11 at 21:26
yes i have tried to read python code, didn't know where to start from,tried the core as it didn't import any of django classes, but it had some wsgi thing in it. and yes my python skills are that of a beginner (maybe a little more than that). The thing i am having trouble with is in knowing how the whole request,get,post work, How are variables connected with requests, how does django's sessions work. the orm is awesome, and frankly, its teaching me a lot about mysql. but the 'request' thing, out of nowhere, i have to use a request.user in a view when i only had request.POST till now..t –  kapv89 Jun 13 '11 at 21:39

2 Answers 2

There is a quote which says:

“Tell me and I'll forget; show me and I may remember; involve me and I'll understand.”

So, the only way to learn is by doing. Maybe you can knock out a basic app in a week, but why stop there? Go on to improve it feature by feature. Think up of something and implement it. That's the only way you will learn.

For a head start, here is an awesome overview of Django: Django’s architecture – the good, the bad, and the ugly

There are many more, but the most important this is to actually implement and learn.

share|improve this answer
I would +1 just for the quote (quote by whom, may I ask?) –  Damien Pirsy Jun 13 '11 at 21:36
The internet says it's some "Chinese Proverb", but there is also a similar quote by Swami Vivekananda ( en.wikipedia.org/wiki/Swami_Vivekananda ) –  zengr Jun 13 '11 at 21:38
Ok, my first guess was Confucius, not so wrong after all. Thank you and sorry for the O.T. :) –  Damien Pirsy Jun 13 '11 at 21:42
you see, the thing is i can implement, according to what i know, most web apps come down to this only ... 1. read users action, 2. do something according to that action 3. Show what you have done to user.... its easy to break down things into these pieces in php, you can understand its code,the server, and request thing is abstracted away, but its visible in django, and it pains me not knowing what they are, how they work... and nice video,thanks –  kapv89 Jun 13 '11 at 21:49

For a better question, you should pick one thing that's going over your head and ask about that first.

That said, it sounds like you've done the tutorial. The thing you need to understand is that Django is not just a web page with code in it. It is code that generates web pages.

It has code that interfaces with the database ("models"), and a template language that generates web pages, and neither of these has inside knowledge of the other. Finally, it has code ("views") which glue all this together.

The interaction with the server is typically through the WSGI interface, which is CGI-like except with Python calling conventions.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.