--
Ticket URL: <https://code.djangoproject.com/ticket/29065>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Collin Anderson (added)
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/9619
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:1>
* type: Uncategorized => Cleanup/optimization
* component: File uploads/storage => Core (Other)
Comment:
I don't see the motivation behind the idea.
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:2>
* cc: Akshesh Doshi (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:3>
Comment (by Collin Anderson):
A few advantages:
If for some reason you can't or have trouble installing pillow, everything
else will work fine. It makes django a bit more "lightweight" to have the
dependency be optional.
Loading Pillow increases memory usage by 5% (2mb) (in my quick testing)
for a runserver on an empty project:
37608kb without loading pillow
39768kb with loading pillow
Also, doesn't matter quite as much, but running "check" also takes about
5% longer (25ms) on an empty project for me when including pillow:
360-400ms without loading pillow
393-424ms with loading pillow
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:4>
* stage: Unreviewed => Accepted
Comment:
+1 to making Pillow truly optional.
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:5>
Comment (by Tim Graham):
Isn't it already "optional" with the `try/except ImportError`? I think the
idea you're proposing is to import it lazily (which could help if it's
installed but unused) which makes sense to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:6>
Comment (by Collin Anderson):
Good point. The installed but unused case is what I'm running into.
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"46b3e3ffdc25b5a42762df20e536401fc512c5f3" 46b3e3f]:
{{{
#!CommitTicketReference repository=""
revision="46b3e3ffdc25b5a42762df20e536401fc512c5f3"
Fixed #29065 -- Made django.core.validators only load Pillow if needed.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29065#comment:8>