5 ms·
> maybe you're right IFF you start using a custom user model from the very beginning, if you happen to forget that, Django will make your life like a hell and w
by acdha 8y ago
> maybe you're right IFF you start using a custom user model from the very beginning, if you happen to forget that, Django will make your life like a hell and will refuse to even pass startup checkups
The startup checks are protecting you from more subtle problems because if you switch to a custom model, you need to do a migration for your stored data. That's a one-time process which can be squashed as soon as you migrate the last server running the old code.
> so you suggest I rewrite my applications to DRF just to have JSON http request decoding?
DRF is a helpful tool which solves a number of common cases but it's not doing anything you can't do in standard Django: that could be as simple as json.loads(request.body) in the appropriate view or, more commonly, a decorator or class-based view which provides standardized error handling, etc.
The reason why the stock forms API doesn't do this by default is that it's designed to support the <form> interface in the HTML standard, which defines a simple key-value interface which is much simpler than what can be expressed in JSON:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-enctype https://html.spec.whatwg.org/multipage/form-control-infrastr...
Once you're moving out of the realm of standard browser interfaces it's much harder to write a generic validation interface suitable for having in a standard library, especially since there are multiple competing ideas of what this should look like and most of them are easily installable from PyPI without the Django project having to support them.