3 ms·
I use a project generator tool for a Django project. One of the things it does is generate setting file using string manipulation. I have been trying to think o
by tecoholic 9mo ago
I use a project generator tool for a Django project. One of the things it does is generate setting file using string manipulation. I have been trying to think of a more sane way to do this. leverage something like dataclass or Pydantic models to have the typing information available and render a typed and validated Python object. If Django ever made that possible, it would be amazing for dev ex.
- Nextgrid 9mo agohttps://docs.pydantic.dev/latest/concepts/pydantic_settings/ https://docs.pydantic.dev/latest/concepts/pydantic_settings/
- tecoholic 9mo agoInteresting. But it’s not straightforward with Django. So I looked up and found this https://github.com/erhosen-libs/pydjantic https://github.com/erhosen-libs/pydjantic Looks promising and will play with it and see how it helps.