Comment by tecoholic
1 month 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.
https://docs.pydantic.dev/latest/concepts/pydantic_settings/
Interesting. But it’s not straightforward with Django. So I looked up and found this
https://github.com/erhosen-libs/pydjantic
Looks promising and will play with it and see how it helps.