Hello community,

here is the log from the commit of package python-django-storages for 
openSUSE:Factory checked in at 2020-01-07 23:54:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-storages (Old)
 and      /work/SRC/openSUSE:Factory/.python-django-storages.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django-storages"

Tue Jan  7 23:54:11 2020 rev:4 rq:761364 version:1.8

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-django-storages/python-django-storages.changes
    2019-09-27 14:48:33.208748374 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-django-storages.new.6675/python-django-storages.changes
  2020-01-07 23:54:38.792071584 +0100
@@ -1,0 +2,6 @@
+Tue Jan  7 09:03:14 UTC 2020 - Tomáš Chvátal <tchva...@suse.com>
+
+- Update to 1.8:
+  * support for django 3.x
+
+-------------------------------------------------------------------

Old:
----
  django-storages-1.7.2.tar.gz

New:
----
  django-storages-1.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-django-storages.spec ++++++
--- /var/tmp/diff_new_pack.lIhf34/_old  2020-01-07 23:54:40.264072348 +0100
+++ /var/tmp/diff_new_pack.lIhf34/_new  2020-01-07 23:54:40.268072350 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-django-storages
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-django-storages
-Version:        1.7.2
+Version:        1.8
 Release:        0
 Summary:        Support for many storage backends in Django
 License:        BSD-3-Clause
@@ -35,7 +35,7 @@
 Suggests:       python-boto >= 2.32.0
 Suggests:       python-boto3 >= 1.4.4
 Suggests:       python-dropbox >= 7.2.1
-Suggests:       python-google-cloud-storage >= 0.22.0
+Suggests:       python-google-cloud-storage >= 1.15.0
 Suggests:       python-paramiko
 BuildArch:      noarch
 # SECTION test requirements
@@ -44,7 +44,7 @@
 BuildRequires:  %{python_module boto >= 2.32.0}
 BuildRequires:  %{python_module boto3 >= 1.4.4}
 BuildRequires:  %{python_module dropbox >= 7.2.1}
-BuildRequires:  %{python_module google-cloud-storage >= 0.22.0}
+BuildRequires:  %{python_module google-cloud-storage >= 1.15.0}
 BuildRequires:  %{python_module paramiko}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  python2-mock

++++++ django-storages-1.7.2.tar.gz -> django-storages-1.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/AUTHORS 
new/django-storages-1.8/AUTHORS
--- old/django-storages-1.7.2/AUTHORS   2019-09-09 06:46:10.000000000 +0200
+++ new/django-storages-1.8/AUTHORS     2019-11-21 08:12:07.000000000 +0100
@@ -37,6 +37,7 @@
     * Jumpei Yoshimura (S3 docs)
     * Jon Dufresne
     * Rodrigo Gadea (Dropbox fixes)
+    * Martey Dodoo
 
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/CHANGELOG.rst 
new/django-storages-1.8/CHANGELOG.rst
--- old/django-storages-1.7.2/CHANGELOG.rst     2019-09-10 10:16:47.000000000 
+0200
+++ new/django-storages-1.8/CHANGELOG.rst       2019-11-21 08:13:26.000000000 
+0100
@@ -1,6 +1,39 @@
 django-storages CHANGELOG
 =========================
 
+1.8 (2019-11-20)
+****************
+
+- Add support for Django 3.0 (`#759`_)
+- Update license identifier to unambiguous ``BSD-3-Clause``
+
+S3
+--
+
+- Include error message raised when missing library is imported (`#776`_, 
`#793`_)
+
+Google
+------
+
+- **Breaking** The minimum supported version of ``google-cloud-storage`` is 
now ``1.15.0`` which enables...
+- Add setting ``GS_CUSTOM_ENDPOINT`` to allow usage of custom domains 
(`#775`_, `#648`_)
+
+Azure
+-----
+
+- Fix extra installation by pinning version to < 12 (`#785`_)
+- Add support for setting ``AZURE_CACHE_CONTROL`` header (`#780`_, `#674`_)
+
+.. _#759: https://github.com/jschneier/django-storages/pull/759
+.. _#776: https://github.com/jschneier/django-storages/issues/776
+.. _#793: https://github.com/jschneier/django-storages/pull/793
+.. _#775: https://github.com/jschneier/django-storages/issues/775
+.. _#648: https://github.com/jschneier/django-storages/pull/648
+.. _#785: https://github.com/jschneier/django-storages/pull/785
+.. _#780: https://github.com/jschneier/django-storages/pull/780
+.. _#674: https://github.com/jschneier/django-storages/issues/674
+
+
 1.7.2 (2019-09-10)
 ******************
 
@@ -8,7 +41,7 @@
 --
 
 - Avoid misleading ``AWS_DEFAULT_ACL`` warning for insecure ``default_acl`` 
when
-  overridden as a class variable (`#591_`)
+  overridden as a class variable (`#591`_)
 - Propagate file deletion to cache when ``preload_metadata`` is ``True``,
   (not the default) (`#743`_, `#749`_)
 - Fix exception raised on closed file (common if using ``ManifestFilesMixin`` 
or
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/PKG-INFO 
new/django-storages-1.8/PKG-INFO
--- old/django-storages-1.7.2/PKG-INFO  2019-09-10 10:18:02.000000000 +0200
+++ new/django-storages-1.8/PKG-INFO    2019-11-21 08:18:00.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 2.1
 Name: django-storages
-Version: 1.7.2
+Version: 1.8
 Summary: Support for many storage backends in Django
 Home-page: https://github.com/jschneier/django-storages
 Author: Josh Schneier
 Author-email: josh.schne...@gmail.com
-License: BSD
+License: BSD-3-Clause
 Description: .. image:: 
https://raw.githubusercontent.com/jschneier/django-storages/master/docs/logos/horizontal.png
             :alt: Django-Storages
             :width: 100%
@@ -106,6 +106,39 @@
         django-storages CHANGELOG
         =========================
         
+        1.8 (2019-11-20)
+        ****************
+        
+        - Add support for Django 3.0 (`#759`_)
+        - Update license identifier to unambiguous ``BSD-3-Clause``
+        
+        S3
+        --
+        
+        - Include error message raised when missing library is imported 
(`#776`_, `#793`_)
+        
+        Google
+        ------
+        
+        - **Breaking** The minimum supported version of 
``google-cloud-storage`` is now ``1.15.0`` which enables...
+        - Add setting ``GS_CUSTOM_ENDPOINT`` to allow usage of custom domains 
(`#775`_, `#648`_)
+        
+        Azure
+        -----
+        
+        - Fix extra installation by pinning version to < 12 (`#785`_)
+        - Add support for setting ``AZURE_CACHE_CONTROL`` header (`#780`_, 
`#674`_)
+        
+        .. _#759: https://github.com/jschneier/django-storages/pull/759
+        .. _#776: https://github.com/jschneier/django-storages/issues/776
+        .. _#793: https://github.com/jschneier/django-storages/pull/793
+        .. _#775: https://github.com/jschneier/django-storages/issues/775
+        .. _#648: https://github.com/jschneier/django-storages/pull/648
+        .. _#785: https://github.com/jschneier/django-storages/pull/785
+        .. _#780: https://github.com/jschneier/django-storages/pull/780
+        .. _#674: https://github.com/jschneier/django-storages/issues/674
+        
+        
         1.7.2 (2019-09-10)
         ******************
         
@@ -113,7 +146,7 @@
         --
         
         - Avoid misleading ``AWS_DEFAULT_ACL`` warning for insecure 
``default_acl`` when
-          overridden as a class variable (`#591_`)
+          overridden as a class variable (`#591`_)
         - Propagate file deletion to cache when ``preload_metadata`` is 
``True``,
           (not the default) (`#743`_, `#749`_)
         - Fix exception raised on closed file (common if using 
``ManifestFilesMixin`` or
@@ -755,6 +788,7 @@
 Classifier: Framework :: Django :: 2.0
 Classifier: Framework :: Django :: 2.1
 Classifier: Framework :: Django :: 2.2
+Classifier: Framework :: Django :: 3.0
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
@@ -768,9 +802,9 @@
 Classifier: Programming Language :: Python :: 3.7
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
 Provides-Extra: azure
+Provides-Extra: dropbox
 Provides-Extra: google
+Provides-Extra: sftp
 Provides-Extra: boto
-Provides-Extra: dropbox
 Provides-Extra: libcloud
-Provides-Extra: sftp
 Provides-Extra: boto3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/django_storages.egg-info/PKG-INFO 
new/django-storages-1.8/django_storages.egg-info/PKG-INFO
--- old/django-storages-1.7.2/django_storages.egg-info/PKG-INFO 2019-09-10 
10:18:02.000000000 +0200
+++ new/django-storages-1.8/django_storages.egg-info/PKG-INFO   2019-11-21 
08:18:00.000000000 +0100
@@ -1,11 +1,11 @@
 Metadata-Version: 2.1
 Name: django-storages
-Version: 1.7.2
+Version: 1.8
 Summary: Support for many storage backends in Django
 Home-page: https://github.com/jschneier/django-storages
 Author: Josh Schneier
 Author-email: josh.schne...@gmail.com
-License: BSD
+License: BSD-3-Clause
 Description: .. image:: 
https://raw.githubusercontent.com/jschneier/django-storages/master/docs/logos/horizontal.png
             :alt: Django-Storages
             :width: 100%
@@ -106,6 +106,39 @@
         django-storages CHANGELOG
         =========================
         
+        1.8 (2019-11-20)
+        ****************
+        
+        - Add support for Django 3.0 (`#759`_)
+        - Update license identifier to unambiguous ``BSD-3-Clause``
+        
+        S3
+        --
+        
+        - Include error message raised when missing library is imported 
(`#776`_, `#793`_)
+        
+        Google
+        ------
+        
+        - **Breaking** The minimum supported version of 
``google-cloud-storage`` is now ``1.15.0`` which enables...
+        - Add setting ``GS_CUSTOM_ENDPOINT`` to allow usage of custom domains 
(`#775`_, `#648`_)
+        
+        Azure
+        -----
+        
+        - Fix extra installation by pinning version to < 12 (`#785`_)
+        - Add support for setting ``AZURE_CACHE_CONTROL`` header (`#780`_, 
`#674`_)
+        
+        .. _#759: https://github.com/jschneier/django-storages/pull/759
+        .. _#776: https://github.com/jschneier/django-storages/issues/776
+        .. _#793: https://github.com/jschneier/django-storages/pull/793
+        .. _#775: https://github.com/jschneier/django-storages/issues/775
+        .. _#648: https://github.com/jschneier/django-storages/pull/648
+        .. _#785: https://github.com/jschneier/django-storages/pull/785
+        .. _#780: https://github.com/jschneier/django-storages/pull/780
+        .. _#674: https://github.com/jschneier/django-storages/issues/674
+        
+        
         1.7.2 (2019-09-10)
         ******************
         
@@ -113,7 +146,7 @@
         --
         
         - Avoid misleading ``AWS_DEFAULT_ACL`` warning for insecure 
``default_acl`` when
-          overridden as a class variable (`#591_`)
+          overridden as a class variable (`#591`_)
         - Propagate file deletion to cache when ``preload_metadata`` is 
``True``,
           (not the default) (`#743`_, `#749`_)
         - Fix exception raised on closed file (common if using 
``ManifestFilesMixin`` or
@@ -755,6 +788,7 @@
 Classifier: Framework :: Django :: 2.0
 Classifier: Framework :: Django :: 2.1
 Classifier: Framework :: Django :: 2.2
+Classifier: Framework :: Django :: 3.0
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
@@ -768,9 +802,9 @@
 Classifier: Programming Language :: Python :: 3.7
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
 Provides-Extra: azure
+Provides-Extra: dropbox
 Provides-Extra: google
+Provides-Extra: sftp
 Provides-Extra: boto
-Provides-Extra: dropbox
 Provides-Extra: libcloud
-Provides-Extra: sftp
 Provides-Extra: boto3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/django_storages.egg-info/requires.txt 
new/django-storages-1.8/django_storages.egg-info/requires.txt
--- old/django-storages-1.7.2/django_storages.egg-info/requires.txt     
2019-09-10 10:18:02.000000000 +0200
+++ new/django-storages-1.8/django_storages.egg-info/requires.txt       
2019-11-21 08:18:00.000000000 +0100
@@ -1,7 +1,7 @@
 Django>=1.11
 
 [azure]
-azure-storage-blob>=1.3.1
+azure-storage-blob<12.0.0,>=1.3.1
 
 [boto]
 boto>=2.32.0
@@ -13,7 +13,7 @@
 dropbox>=7.2.1
 
 [google]
-google-cloud-storage>=0.22.0
+google-cloud-storage>=1.15.0
 
 [libcloud]
 apache-libcloud
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/docs/backends/azure.rst 
new/django-storages-1.8/docs/backends/azure.rst
--- old/django-storages-1.7.2/docs/backends/azure.rst   2019-09-10 
08:18:51.000000000 +0200
+++ new/django-storages-1.8/docs/backends/azure.rst     2019-11-21 
08:12:07.000000000 +0100
@@ -159,3 +159,9 @@
 
     A token credential used to authenticate HTTPS requests. The token value
     should be updated before its expiration.
+
+
+``AZURE_CACHE_CONTROL``
+
+    A variable to set the Cache-Control HTTP response header. E.g. 
+    ``AZURE_CACHE_CONTROL = "public,max-age=31536000,immutable"``
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/docs/backends/digital-ocean-spaces.rst 
new/django-storages-1.8/docs/backends/digital-ocean-spaces.rst
--- old/django-storages-1.7.2/docs/backends/digital-ocean-spaces.rst    
2018-10-02 05:27:46.000000000 +0200
+++ new/django-storages-1.8/docs/backends/digital-ocean-spaces.rst      
2019-11-18 03:19:13.000000000 +0100
@@ -4,5 +4,5 @@
 Digital Ocean Spaces implements the S3 protocol. To use it follow the 
instructions in the :doc:`Amazon S3 docs <amazon-S3>` with the important 
caveats that you must:
 
 - Set ``AWS_S3_REGION_NAME`` to your Digital Ocean region (such as ``nyc3`` or 
``sfo2``)
-- Set ``AWS_S3_ENDPOINT_URL`` to the value of 
``${AWS_S3_REGION_NAME}.digitaloceanspaces.com``
+- Set ``AWS_S3_ENDPOINT_URL`` to the value of 
``https://${AWS_S3_REGION_NAME}.digitaloceanspaces.com``
 - Set the values of ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY`` to the 
corresponding values from Digital Ocean
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/docs/backends/gcloud.rst 
new/django-storages-1.8/docs/backends/gcloud.rst
--- old/django-storages-1.7.2/docs/backends/gcloud.rst  2019-09-10 
10:14:49.000000000 +0200
+++ new/django-storages-1.8/docs/backends/gcloud.rst    2019-11-21 
08:12:07.000000000 +0100
@@ -149,6 +149,11 @@
 
 Sets Cache-Control HTTP header for the file, more about HTTP caching can be 
found `here 
<https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#cache-control>`_
 
+``GS_CUSTOM_ENDPOINT`` (optional: default is ``None``)
+
+Sets a `custom endpoint 
<https://cloud.google.com/storage/docs/request-endpoints>`_,
+that will be used instead of ``https://storage.googleapis.com`` when 
generating URLs for files.
+
 ``GS_LOCATION`` (optional: default is ``''``)
 
 Subdirectory in which the files will be stored.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/setup.py 
new/django-storages-1.8/setup.py
--- old/django-storages-1.7.2/setup.py  2019-09-09 06:46:10.000000000 +0200
+++ new/django-storages-1.8/setup.py    2019-11-21 08:12:07.000000000 +0100
@@ -15,17 +15,17 @@
     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
     install_requires=['Django>=1.11'],
     extras_require={
-        'azure': ['azure-storage-blob>=1.3.1'],
+        'azure': ['azure-storage-blob>=1.3.1,<12.0.0'],
         'boto': ['boto>=2.32.0'],
         'boto3': ['boto3>=1.4.4'],
         'dropbox': ['dropbox>=7.2.1'],
-        'google': ['google-cloud-storage>=0.22.0'],
+        'google': ['google-cloud-storage>=1.15.0'],
         'libcloud': ['apache-libcloud'],
         'sftp': ['paramiko'],
     },
     author='Josh Schneier',
     author_email='josh.schne...@gmail.com',
-    license='BSD',
+    license='BSD-3-Clause',
     description='Support for many storage backends in Django',
     long_description=read('README.rst') + '\n\n' + read('CHANGELOG.rst'),
     url='https://github.com/jschneier/django-storages',
@@ -37,6 +37,7 @@
         'Framework :: Django :: 2.0',
         'Framework :: Django :: 2.1',
         'Framework :: Django :: 2.2',
+        'Framework :: Django :: 3.0',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: BSD License',
         'Operating System :: OS Independent',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/storages/__init__.py 
new/django-storages-1.8/storages/__init__.py
--- old/django-storages-1.7.2/storages/__init__.py      2019-09-10 
10:16:40.000000000 +0200
+++ new/django-storages-1.8/storages/__init__.py        2019-11-21 
08:13:37.000000000 +0100
@@ -1 +1 @@
-__version__ = '1.7.2'
+__version__ = '1.8'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/storages/backends/apache_libcloud.py 
new/django-storages-1.8/storages/backends/apache_libcloud.py
--- old/django-storages-1.7.2/storages/backends/apache_libcloud.py      
2019-09-08 08:14:27.000000000 +0200
+++ new/django-storages-1.8/storages/backends/apache_libcloud.py        
2019-09-10 19:32:57.000000000 +0200
@@ -9,8 +9,13 @@
 from django.core.files.base import File
 from django.core.files.storage import Storage
 from django.utils.deconstruct import deconstructible
-from django.utils.six import string_types
-from django.utils.six.moves.urllib.parse import urljoin
+
+try:
+    from django.utils.six import string_types
+    from django.utils.six.moves.urllib.parse import urljoin
+except ImportError:
+    string_types = str
+    from urllib.parse import urljoin
 
 try:
     from libcloud.storage.providers import get_driver
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/storages/backends/azure_storage.py 
new/django-storages-1.8/storages/backends/azure_storage.py
--- old/django-storages-1.7.2/storages/backends/azure_storage.py        
2019-09-10 08:56:41.000000000 +0200
+++ new/django-storages-1.8/storages/backends/azure_storage.py  2019-11-21 
08:12:07.000000000 +0100
@@ -134,6 +134,7 @@
     overwrite_files = setting('AZURE_OVERWRITE_FILES', False)
     location = setting('AZURE_LOCATION', '')
     default_content_type = 'application/octet-stream'
+    cache_control = setting("AZURE_CACHE_CONTROL")
     is_emulated = setting('AZURE_EMULATED_MODE', False)
     endpoint_suffix = setting('AZURE_ENDPOINT_SUFFIX')
     sas_token = setting('AZURE_SAS_TOKEN')
@@ -255,7 +256,8 @@
             stream=content,
             content_settings=ContentSettings(
                 content_type=content_type,
-                content_encoding=content_encoding),
+                content_encoding=content_encoding,
+                cache_control=self.cache_control),
             max_connections=self.upload_max_conn,
             timeout=self.timeout)
         return cleaned_name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/storages/backends/ftp.py 
new/django-storages-1.8/storages/backends/ftp.py
--- old/django-storages-1.7.2/storages/backends/ftp.py  2019-09-08 
08:14:27.000000000 +0200
+++ new/django-storages-1.8/storages/backends/ftp.py    2019-09-10 
19:32:57.000000000 +0200
@@ -24,10 +24,14 @@
 from django.core.files.base import File
 from django.core.files.storage import Storage
 from django.utils.deconstruct import deconstructible
-from django.utils.six.moves.urllib import parse as urlparse
 
 from storages.utils import setting
 
+try:
+    from django.utils.six.moves.urllib import parse as urlparse
+except ImportError:
+    from urllib import parse as urlparse
+
 
 class FTPStorageException(Exception):
     pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/storages/backends/gcloud.py 
new/django-storages-1.8/storages/backends/gcloud.py
--- old/django-storages-1.7.2/storages/backends/gcloud.py       2019-09-10 
10:14:47.000000000 +0200
+++ new/django-storages-1.8/storages/backends/gcloud.py 2019-11-21 
08:12:07.000000000 +0100
@@ -16,6 +16,7 @@
 
 try:
     from google.cloud.storage import Blob, Client
+    from google.cloud.storage.blob import _quote
     from google.cloud.exceptions import Conflict, NotFound
 except ImportError:
     raise ImproperlyConfigured("Could not load Google Cloud Storage 
bindings.\n"
@@ -88,6 +89,7 @@
     project_id = setting('GS_PROJECT_ID')
     credentials = setting('GS_CREDENTIALS')
     bucket_name = setting('GS_BUCKET_NAME')
+    custom_endpoint = setting('GS_CUSTOM_ENDPOINT', None)
     location = setting('GS_LOCATION', '')
     auto_create_bucket = setting('GS_AUTO_CREATE_BUCKET', False)
     auto_create_acl = setting('GS_AUTO_CREATE_ACL', 'projectPrivate')
@@ -263,9 +265,20 @@
         name = self._normalize_name(clean_name(name))
         blob = self.bucket.blob(self._encode_name(name))
 
-        if self.default_acl == 'publicRead':
+        if not self.custom_endpoint and self.default_acl == 'publicRead':
             return blob.public_url
-        return blob.generate_signed_url(self.expiration)
+        elif self.default_acl == 'publicRead':
+            return '{storage_base_url}/{quoted_name}'.format(
+                storage_base_url=self.custom_endpoint,
+                quoted_name=_quote(name, safe=b"/~"),
+            )
+        elif not self.custom_endpoint:
+            return blob.generate_signed_url(self.expiration)
+        else:
+            return blob.generate_signed_url(
+                expiration=self.expiration,
+                api_access_endpoint=self.custom_endpoint,
+            )
 
     def get_available_name(self, name, max_length=None):
         name = clean_name(name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/storages/backends/s3boto3.py 
new/django-storages-1.8/storages/backends/s3boto3.py
--- old/django-storages-1.7.2/storages/backends/s3boto3.py      2019-09-10 
09:23:59.000000000 +0200
+++ new/django-storages-1.8/storages/backends/s3boto3.py        2019-11-18 
06:54:38.000000000 +0100
@@ -15,7 +15,6 @@
 from django.utils.encoding import (
     filepath_to_uri, force_bytes, force_text, smart_text,
 )
-from django.utils.six.moves.urllib import parse as urlparse
 from django.utils.timezone import is_naive, make_naive
 
 from storages.utils import (
@@ -24,13 +23,18 @@
 )
 
 try:
+    from django.utils.six.moves.urllib import parse as urlparse
+except ImportError:
+    from urllib import parse as urlparse
+
+
+try:
     import boto3.session
     from boto3 import __version__ as boto3_version
     from botocore.client import Config
     from botocore.exceptions import ClientError
-except ImportError:
-    raise ImproperlyConfigured("Could not load Boto3's S3 bindings.\n"
-                               "See https://github.com/boto/boto3";)
+except ImportError as e:
+    raise ImproperlyConfigured("Could not load Boto3's S3 bindings. %s" % e)
 
 
 boto3_version_info = tuple([int(i) for i in boto3_version.split('.')])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-storages-1.7.2/storages/backends/sftpstorage.py 
new/django-storages-1.8/storages/backends/sftpstorage.py
--- old/django-storages-1.7.2/storages/backends/sftpstorage.py  2019-09-09 
06:46:10.000000000 +0200
+++ new/django-storages-1.8/storages/backends/sftpstorage.py    2019-09-10 
19:32:57.000000000 +0200
@@ -16,10 +16,14 @@
 from django.core.files.base import File
 from django.core.files.storage import Storage
 from django.utils.deconstruct import deconstructible
-from django.utils.six.moves.urllib import parse as urlparse
 
 from storages.utils import setting
 
+try:
+    from django.utils.six.moves.urllib import parse as urlparse
+except ImportError:
+    from urllib import parse as urlparse
+
 
 @deconstructible
 class SFTPStorage(Storage):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/tests/test_azure.py 
new/django-storages-1.8/tests/test_azure.py
--- old/django-storages-1.7.2/tests/test_azure.py       2019-09-10 
08:18:51.000000000 +0200
+++ new/django-storages-1.8/tests/test_azure.py 2019-11-21 08:12:07.000000000 
+0100
@@ -304,7 +304,8 @@
                 timeout=20)
             c_mocked.assert_called_once_with(
                 content_type='text/plain',
-                content_encoding=None)
+                content_encoding=None,
+                cache_control=None)
 
     def test_storage_open_write(self):
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/tests/test_gcloud.py 
new/django-storages-1.8/tests/test_gcloud.py
--- old/django-storages-1.7.2/tests/test_gcloud.py      2019-09-10 
10:14:47.000000000 +0200
+++ new/django-storages-1.8/tests/test_gcloud.py        2019-11-21 
08:12:07.000000000 +0100
@@ -372,6 +372,22 @@
         self.assertEqual(url, 'http://signed_url')
         blob.generate_signed_url.assert_called_with(timedelta(seconds=3600))
 
+    def test_custom_endpoint(self):
+        self.storage.custom_endpoint = "https://example.com";
+
+        self.storage.default_acl = 'publicRead'
+        url = "{}/{}".format(self.storage.custom_endpoint, self.filename)
+        self.assertEqual(self.storage.url(self.filename), url)
+
+        signed_url = 'https://signed_url'
+        self.storage.default_acl = 'projectPrivate'
+        self.storage._bucket = mock.MagicMock()
+        blob = mock.MagicMock()
+        generate_signed_url = mock.MagicMock(return_value=signed_url)
+        blob.generate_signed_url = generate_signed_url
+        self.storage._bucket.blob.return_value = blob
+        self.assertEqual(self.storage.url(self.filename), signed_url)
+
     def test_get_available_name(self):
         self.storage.file_overwrite = True
         self.assertEqual(self.storage.get_available_name(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/tests/test_s3boto.py 
new/django-storages-1.8/tests/test_s3boto.py
--- old/django-storages-1.7.2/tests/test_s3boto.py      2019-09-08 
08:14:27.000000000 +0200
+++ new/django-storages-1.8/tests/test_s3boto.py        2019-09-10 
19:32:57.000000000 +0200
@@ -12,10 +12,14 @@
 from django.core.files.base import ContentFile
 from django.test import TestCase
 from django.utils import timezone as tz
-from django.utils.six.moves.urllib import parse as urlparse
 
 from storages.backends import s3boto
 
+try:
+    from django.utils.six.moves.urllib import parse as urlparse
+except ImportError:
+    from urllib import parse as urlparse
+
 
 class S3BotoTestCase(TestCase):
     @mock.patch('storages.backends.s3boto.S3Connection')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-storages-1.7.2/tests/test_s3boto3.py 
new/django-storages-1.8/tests/test_s3boto3.py
--- old/django-storages-1.7.2/tests/test_s3boto3.py     2019-09-10 
09:23:59.000000000 +0200
+++ new/django-storages-1.8/tests/test_s3boto3.py       2019-09-10 
19:32:57.000000000 +0200
@@ -13,12 +13,17 @@
 from django.core.exceptions import ImproperlyConfigured
 from django.core.files.base import ContentFile
 from django.test import TestCase, override_settings
-from django.utils.six.moves.urllib import parse as urlparse
 from django.utils.timezone import is_aware, utc
 
 from storages.backends import s3boto3
 
 try:
+    from django.utils.six.moves.urllib import parse as urlparse
+except ImportError:
+    from urllib import parse as urlparse
+
+
+try:
     from unittest import mock
 except ImportError:  # Python 3.2 and below
     import mock


Reply via email to