Live data from Hacker News

Django for a Rails Developer

uswaretech.com

21–30 of 33 posts

Re: Django for a Rails Developer

#22
post #6

Earlier quoted context omitted.

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.

Sometimes I wonder if they renamed the pattern just to keep up the music theme...

Re: Django for a Rails Developer

#23
post #18

I work with Django for a living but the lack of init/buildout in a new project has always driven me a bit nuts, I guess it's one of my development pet-peeves. I'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…

And your script probably sets things up differently from everyone else's :)

But if you think it's a problem, why not publish whatever you use and encourage others to use it as well?

(also, FWIW I don't have such a script -- a new site at work always simply inherits default settings from other stuff, and those defaults are set up to match how our production servers work)

Re: Django for a Rails Developer

#24
post #20

Also note that the default Django template is showing it's age. I don't think it's ever been updated and it contains a few faux-pas to look out for. In particular, it starts you off inside a python package (__init__.py file), which is highly confusing. If you later want to treat your Django project as a normal Python project, you need to create a setup.py file. But this file would be one directory up from the project…

Well, to be perfectly honest I almost never use the 'startproject' or 'startapp' commands. When I'm working on a new app I just create the directory and an __init__.py, and then start filling in specific files inside it as I need them.

For stuff at work apps all go into one of a couple particular namespaces, so packaging concerns don't come up there; for my personal stuff the package name is almost never the same as the app anyway (e.g., django-registration provides an app in a module named 'registration').

Also, I'd really really like the concept of the project to die soon.

Re: Django for a Rails Developer

#26
The most annoying part about doing Django as a dev coming from Rails is the RequestContext that isn't used by default, if you want to access specific contexts like settings. Then it means having to hack it using direct_to_template or writing a decorator.

It's a different philosophy, but it's hard getting use to having to explicitly spell out everything when I just want to get going with defaults that make sense.

Post reply on HN