Live data from Hacker News

Django for a Rails Developer

uswaretech.com

1–10 of 33 posts

Re: Django for a Rails Developer

#3
"Why not create a ‘templates’ directoy and a ‘base.html’ either in project’s directory or in the apps’s directory, because creating the same templates directory and same base.html for every project is not DRY?"

There's nothing wrong with that. Even the djangoproject.com website does it: http://code.djangoproject.com/browser/djangoproject.com/djan...

"Why serving static files in development has to be a additional setup, as no developer wants to setup a server for serving static files, I am aware of ‘django.static.serve’ but still that is an additional setup, why not create a sample media directory and a url for the same in urls.py ?"

Read this: http://www.b-list.org/weblog/2008/jun/23/media/

Re: Django for a Rails Developer

#4
post #3

" Why not create a ‘templates’ directoy and a ‘base.html’ either in project’s directory or in the apps’s directory, because creating the same templates directory and same base.html for every project is not DRY? " There's nothing wrong with that. Even the djangoproject.com website does it: http://code.djangoproject.com/browser/djangoproject.com/djan... " Why serving static files in development has to be a additional s…

The question is, why not the framework create it automatically ? why one has to create it manually every time a project/app is created ? Atleast a default template directory and a standard base.html on a project level will reduce the repetitive work.

Re: Django for a Rails Developer

#5
For me the hardest thing about Django was comprehending that the 'View' is doing most of the work.

* urls point to views

* views do stuff. Perhaps hard, manly stuff. Perhaps involving models. Django views have hard, beefy beceps. They're awfully controlling.

* the view passes a dict of results to the template, which is sent as a response to the browser.

Once you get that, it's not so hard.

Re: Django for a Rails Developer

#6
post #5

For me the hardest thing about Django was comprehending that the 'View' is doing most of the work. * urls point to views * views do stuff. Perhaps hard, manly stuff. Perhaps involving models. Django views have hard, beefy beceps. They're awfully controlling. * the view passes a dict of results to the template, which is sent as a response to the browser. Once you get that, it's not so hard.

Actually, if you apply the MVC paradigm, the Django View is a mix of View and Controller. Admittedly a little confusing

Re: Django for a Rails Developer

#7
post #5

For me the hardest thing about Django was comprehending that the 'View' is doing most of the work. * urls point to views * views do stuff. Perhaps hard, manly stuff. Perhaps involving models. Django views have hard, beefy beceps. They're awfully controlling. * the view passes a dict of results to the template, which is sent as a response to the browser. Once you get that, it's not so hard.

A perfect tl;dr.

Re: Django for a Rails Developer

#8
post #6
post #5

For me the hardest thing about Django was comprehending that the 'View' is doing most of the work. * urls point to views * views do stuff. Perhaps hard, manly stuff. Perhaps involving models. Django views have hard, beefy beceps. They're awfully controlling. * the view passes a dict of results to the template, which is sent as a response to the browser. Once you get that, it's not so hard.

Actually, if you apply the MVC paradigm, the Django View is a mix of View and Controller. Admittedly a little confusing

Hence, it is defined as MTV.

Re: Django for a Rails Developer

#9
post #5

For me the hardest thing about Django was comprehending that the 'View' is doing most of the work. * urls point to views * views do stuff. Perhaps hard, manly stuff. Perhaps involving models. Django views have hard, beefy beceps. They're awfully controlling. * the view passes a dict of results to the template, which is sent as a response to the browser. Once you get that, it's not so hard.

Perfectly stated. I still have the piece of paper from a couple of years ago where I drew this out (I'm both analytical and spatial/visual), and my holistic diagram looks just like what you wrote.

At the risk of being negative, I think the real issue is that the extensive documentation is geared more towards designers than hackers.

Re: Django for a Rails Developer

#10
"Why serving static files in development has to be a additional setup, as no developer wants to setup a server for serving static files, I am aware of ‘django.static.serve’ but still that is an additional setup, why not create a sample media directory and a url for the same in urls.py" - Because typical deployments don't use django for serving static files?
Post reply on HN