diff -Nur a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py
--- a/django/contrib/gis/gdal/libgdal.py	2020-07-09 22:34:05.330568948 +0100
+++ b/django/contrib/gis/gdal/libgdal.py	2020-07-09 22:35:08.679095615 +0100
@@ -14,7 +14,7 @@
     from django.conf import settings
     lib_path = settings.GDAL_LIBRARY_PATH
 except (AttributeError, ImportError, ImproperlyConfigured, OSError):
-    lib_path = None
+    lib_path = "@gdal@/lib/libgdal@extension@"

 if lib_path:
     lib_names = None
diff -Nur a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
--- a/django/contrib/gis/geos/libgeos.py	2020-07-09 22:34:05.331568941 +0100
+++ b/django/contrib/gis/geos/libgeos.py	2020-07-09 22:36:24.863526276 +0100
@@ -24,7 +24,7 @@
         from django.conf import settings
         lib_path = settings.GEOS_LIBRARY_PATH
     except (AttributeError, ImportError, ImproperlyConfigured, OSError):
-        lib_path = None
+        lib_path = "@geos_3_9@/lib/libgeos_c@extension@"

     # Setting the appropriate names for the GEOS-C library.
     if lib_path:
