#36441: Add lazy loading support for GDAL library in `django.contrib.gis.gdal`
-------------------------------------+-------------------------------------
     Reporter:  Josh Thomas          |                    Owner:  Josh
         Type:                       |  Thomas
  Cleanup/optimization               |                   Status:  assigned
    Component:  GIS                  |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  gdal                 |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

 I think I'm missing your meaning, Tim -- why do you refer to GDAL as
 optional? Your link docs both libraries as required, and I'm not aware of
 test configurations supporting the idea that it's optional.

 Josh is writing [https://github.com/joshuadavidthomas/django-language-
 server a language server] where he wants to be able defer the imports.
 That's not a typical use case, so I think it's fair to ask his project to
 silence a system check (I'm assuming a language server would skip all
 checks anyway for speed). I don't think that makes GDAL "optional" for
 most `contrib.gis` installs.

 > I would like to see my questions in comment:13 answered in order to
 understand how a "missing GDAL" error would be surfaced to a user.

 The PR has the effect of deferring any `ImproperlyConfigured` exception
 from startup to the first use of GDAL, presumably in a view. For a site-
 wide context processor, every view would fail, so you'd have a reasonable
 chance of catching it immediately (indeed, the test project I'm using does
 this). But where GIS is used more sparingly (e.g. just in an admin
 widget), you wouldn't. The failure would be deferred until someone logged
 into the admin. Deferring the error to an indeterminate time seems like an
 unwelcome change. Am I understanding your question?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36441#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019a1c1f5d2f-0fc1f71f-e405-44a5-b995-ed4ab7b87169-000000%40eu-central-1.amazonses.com.

Reply via email to