3 ms·
Django requires you to have imported settings.py and be connected to the database first, before you can even import a model. It makes it impossible to write mod
by Too 4y ago
Django requires you to have imported settings.py and be connected to the database first, before you can even import a model. It makes it impossible to write modules with type hints and modules which are partially usable outside of Django context.
If that is not dictating how you write your code, I don’t know what is.
- ensignavenger 4y agoIf you are connectiong to a database, you have to tell your program how to connect somewhere. The Django ORM does it through settings.py. I do both of the things you say are impossible, so maybe I am misunderstanding?