"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?
Django for a Rails Developer
11–20 of 33 posts
Re: Django for a Rails Developer
#12Anyone knows if this exists vice-versa?
Re: Django for a Rails Developer
#13Re: Django for a Rails Developer
#14For 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
#15"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?
however typical developments do, and this question is about typical development setup
Re: Django for a Rails Developer
#16Earlier quoted context omitted.
however typical developments do, and this question is about typical development setup
Agree. What we probably need is a nice way to switch between deployment/development setups, possibly by splitting settings.py like rails
put all of your environment-specific variables in there, and put 'from local_settings.py import *' at the end of your settings.py
Re: Django for a Rails Developer
#17" 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.
But if you want it right now: create a custom command to do it your way and wrap it in an app that you add to the path. When you start a new project, the first thing you do is add the application to your installed apps and you can use it over and over again.
Re: Django for a Rails Developer
#18I've never had project that didn't need:
- a project-wide templates/ directory - media/[css|img|js] directories - some kind of database setup by default - contrib.admin (well, I created a form mailer once that had no admin)
Django seems to take a "we don't want to force you to use any particular setup" stance, but the result seems to be to force you to make a bunch of relatively meaningless decisions before you can start writing code. (they could have other reasons, I haven't looked into it lately)
These days I have a script that does all this, and I know others have written similar scripts as well. It just strikes me as being a gaping hole on the Django development model... IMO anyway.
Re: Django for a Rails Developer
#19" 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
#20(Speaking of /bin directories, it's always bugged me that Rails renamed this directory to /scripts ... if it's executable, it goes in /bin, it makes no sense to split executables based on arbitrary implementation details)