Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Cloud Storage backend using the gcloud-python library #236

Merged
merged 28 commits into from
Apr 19, 2017
Merged

Add Google Cloud Storage backend using the gcloud-python library #236

merged 28 commits into from
Apr 19, 2017

Commits on Apr 10, 2017

  1. Configuration menu
    Copy the full SHA
    2f6f6e7 View commit details
    Browse the repository at this point in the history
  2. Rename to gcloud, and import google.cloud

    The "gcloud" Python module is now called "google.cloud", so use the new
    name.  This means the name of this module needs to change too, since it
    can no longer be "google".
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    85c53b5 View commit details
    Browse the repository at this point in the history
  3. Add @deconstructible to GoogleCloudStorage

    This decorator is required to allow Django 1.7 migrations to serialize
    instances of this class.  Without the decorator, running "makemigrations"
    on code like the following will fail with a "Cannot Serialize" error.
    
    from storages.backends.gcloud import GoogleCloudStorage
    
    gcs = GoogleCloudStorage()
    
    class SomeModel(models.Models):
        some_field = models.FileField(storage=gcs)
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    b3ec8b5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ddc32b View commit details
    Browse the repository at this point in the history
  5. Fix name in error message

    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    8105cba View commit details
    Browse the repository at this point in the history
  6. Move clean_name to utils

    We want to use this in the Google Cloud Storage backend as well.
    
    This is a separate commit so we can verify the clean_name tests in s3boto
    still pass (before I move those as well).
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    7cb67d5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    159b003 View commit details
    Browse the repository at this point in the history
  8. Use utils.clean_name()

    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    621391a View commit details
    Browse the repository at this point in the history
  9. Remove _normalize_name

    This is used by s3boto to support the AWS_LOCATION setting, which isn't
    needed by Google Cloud Storage
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    058972f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    cbe2530 View commit details
    Browse the repository at this point in the history
  11. Move safe_join to utils

    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    189233a View commit details
    Browse the repository at this point in the history
  12. Add and use _normalize_name() like in s3boto

    We need this even though we don't have "location" support since it undoes
    some of the weirdness (e.g. adding './' at the beginning of some paths)
    done by clean_name().
    
    It would be possible to do this more simply but doing it this way makes
    things consistent with s3boto.
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    3829f9a View commit details
    Browse the repository at this point in the history
  13. Remove unused function

    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    e16800e View commit details
    Browse the repository at this point in the history
  14. Only create a Blob in write mode

    This is needed so we can detect attempts to open nonexistent files
    in read mode.
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    0d61513 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    dfe90b5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    9ad54cb View commit details
    Browse the repository at this point in the history
  17. Import Storage directly

    This fixes test failures caused by compat.py being removed as a result
    of dropping Django 1.7 support.
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    b37a9cb View commit details
    Browse the repository at this point in the history
  18. Use byte string for test read

    Fixes tests in Python 3.x
    scjody committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    74f3841 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e8fc9fb View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2017

  1. Address review comments

    scjody committed Apr 11, 2017
    Configuration menu
    Copy the full SHA
    737ac57 View commit details
    Browse the repository at this point in the history
  2. Fix modified_time; add get_modified_time

    `modified_time` always returns a naive datetime.
    `get_modified_time`'s return depends on the USE_TZ setting.
    scjody committed Apr 11, 2017
    Configuration menu
    Copy the full SHA
    44f39cd View commit details
    Browse the repository at this point in the history
  3. Test and fix unicode handling

    scjody committed Apr 11, 2017
    Configuration menu
    Copy the full SHA
    bb9307f View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2017

  1. Address further review comments

    * Remove unused argument
    * Return filename when file does not exist
    scjody committed Apr 12, 2017
    Configuration menu
    Copy the full SHA
    acbe31d View commit details
    Browse the repository at this point in the history
  2. Remove *args and **kwargs

    This required handling the num_bytes argument explicitly, so that's now
    tested.
    scjody committed Apr 12, 2017
    Configuration menu
    Copy the full SHA
    02e5829 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1d2e206 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2017

  1. Configuration menu
    Copy the full SHA
    bbb203e View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2017

  1. Configuration menu
    Copy the full SHA
    598753b View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2017

  1. Address final PR comments

    * Simplify `num_bytes=None` handling
    * Make the `gs` warning a `DeprecationWarning`
    scjody committed Apr 19, 2017
    Configuration menu
    Copy the full SHA
    7ee116b View commit details
    Browse the repository at this point in the history