Reputation: 272432
What if I'm importing 100 things ? (In the top of my views.py)
And then inside each of them, I'm importing 30 things.
Will that slow things down?
Upvotes: 3
Views: 339
Reputation: 318808
It will slow down startup (actually, whatever loads the file containing those imports the first time will be slowed down). Assuming django does not do that for every request but only once, it is not an issue at all.
Upvotes: 4
Reputation: 799560
Only the first time they're imported in the process. After that, all that happens is that a reference is copied to the local scope.
Upvotes: 3