Django's Architecture: The Good, The Bad, and The Ugly
speakerdeck.com
speakerdeck.com
South provides stable and mature migrations for schema changes [1]
Custom Auth models are now available in Django 1.5 [2]
The templating language definitely needs some work, but it's slowly getting better. I'd prefer them drop in Jinja2 but that's just me.
[1] http://south.readthedocs.org/en/latest/
[2] https://docs.djangoproject.com/en/1.5/topics/auth/customizin...
Also, how about defaulting to bootstrap for the homely-looking admin app?
It seems to me that it does what it set out to do. Well.
If you want bootstrap BTW, this is a dropin addon https://github.com/riccardo-forina/django-admin-bootstrapped
Also, the admin app isn't supposed to be client-facing; it's a very effective but not-extremely-user-friendly way to view data without having to resort to SSH'ing in and running ORM queries on Django's CLI (or, worse, the database's CLI).
You can use it that way (and many of us have; I'm not innocent), but encouraging that with a pretty application of Bootstrap will likely give a lot of new developers the wrong idea on the tool's purpose.
The widgets are fine-looking, though increasingly dated. Why not outsource this work to someone who cares about it? Its community must dwarf Django's.
There's some truth to your statement about encouragement, but it reminds me of the phrase, don't "cut off your nose to spite your face." Plus, it isn't the author's place to dictate how the user will use it.
In the meantime, South still works quite well.
It doesn't seem to be a common complaint, but I always end up fighting with Forms when I try to use them. Too complicated, too confining, and too unique-to-Django. I wish Django had gone with field helpers instead.
> {{ form.thefield }}
You would instead simply define the model and render the form field with something like this:
> {{ model.thefield | render_input }}
Or, if you had a regular Form (i.e. not a ModelForm) you would do something like this:
> {{ render_input:name="field_name" }}
And if you wanted validation or something, you'd need to create your own render_* methods to perform that validation.
It's common in other web frameworks. At least Codeigniter, Ruby on Rails, and ASP.NET MVC use this approach:
http://ellislab.com/codeigniter/user-guide/helpers/form_help...
http://guides.rubyonrails.org/form_helpers.html
http://msdn.microsoft.com/en-us/library/dd410596(v=vs.100).a...
c = r"[-!#$%&'*+/=?^_`{}|~0-9A-Z]"
dot_atom = r"{c}+(\.{c}+)*".format(c=c)
c1 = r"[\001-\010\013\014\016-\037!#-\[\]-\177]"
c2 = r"[\001-\011\013\014\016-\177]"
quoted_string = r"'({c1}|\\{c2})*'".format(c1=c1, c2=c2)
c = r"[A-Z0-9]"
dash_something = r"(?:-*{c}+)".format(c=c)
domain = r"(?:{c}+{dash_something}\.)+{c}{{2,6}}".format(c=c, dash_something=dash_something)
email = "^({dot_atom}|{quoted_string})@{domain}$"
There's a typo in the original, which I fixed: \001-011 should be \001-\011.The auth customization story has improved recently in 1.5, and the author of this very presentation (Andrew Goodwin) is bringing support for schema changes into the core with his post-South project:
http://www.kickstarter.com/projects/andrewgodwin/schema-migr...
It just shows that when developers need something (database migrations) they are usually willingly to Kickstart something.
I hope these sorts of things continue for things that need to be done but aren't actively worked on.
Mmm Belgian beer.
What you can do in SqlAlchemy is, your business-objects could be not some inheritances from some "Model" class, but rather just pure python objects. So you'd implement your business-logic without any knowledge of database etc (ok, you'd use some abstract interface for querying those objects). Then, you describe your "models" as objects representing your database schema (and data structures inside it). It's not the same as your business-objects and can differ quite a bit. And at the end, you "map" one to another, so that ORM only comes in when you map your business-objects into your models.
I'm still not sure why django models are not ORM, maybe because there's no mapping (as I described) going on. Personally I'm fine with ORM termin for django models :)