HackerTrans
TopNewTrendsCommentsPastAskShowJobs

brento

no profile record

Submissions

Improving the New Django Developer Experience

epicserve.com
2 points·by brento·vor 2 Jahren·2 comments

Serialize Django Data for JavaScript

epicserve.com
6 points·by brento·vor 4 Jahren·16 comments

comments

brento
·vor 2 Jahren·discuss
Dj-beat-drop is more about making minimal changes to the official Django templates. It mainly involves standardizing to a config directory for configuration code and optionally using an `env` file and `uv` for package management.

By keeping things minimal, the chances of it getting accepted as an official Django project seem better. It would need to be renamed, of course, to something like django-installer or django-cli.
brento
·vor 4 Jahren·discuss
I've updated the article based on some of the feedback.
brento
·vor 4 Jahren·discuss
This is valid. I'll add an update to the post people should use caution and think about security.
brento
·vor 4 Jahren·discuss
In the article, you'll notice I'm not using DRF.
brento
·vor 4 Jahren·discuss
I would certainly make improvements to the script to optimize the serialization of the QuerySet to only output the needed fields. It's hard to write an article that would capture every use case and optimization required.
brento
·vor 4 Jahren·discuss
See my comment here: https://news.ycombinator.com/item?id=32750266
brento
·vor 4 Jahren·discuss
This is an excellent point; I should have addressed safety in my article. I'll point out that in my use case, I'm using `safe` on data I create and not any user-generated data.

You should never use `safe` on user data unless you use something like bleach (https://github.com/mozilla/bleach) to sanitize the data. Even then, you should use caution.
brento
·vor 4 Jahren·discuss
Thank you for pointing this out, I forgot about this template filter. This unfortunately still wouldn't properly all the data types mentioned in my article (e.g. QuerySets).
brento
·vor 4 Jahren·discuss
Here is the related change.org petition I signed.

https://www.change.org/p/google-account-migration-from-works...