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

Proposal to make django-oss-storage work with aliyun CDN #15

Open
favoyang opened this issue May 15, 2018 · 0 comments
Open

Proposal to make django-oss-storage work with aliyun CDN #15

favoyang opened this issue May 15, 2018 · 0 comments

Comments

@favoyang
Copy link
Contributor

favoyang commented May 15, 2018

The current implementation assigns OssMediaStorage.location from settings.MEDIA_URL (default value is '/media/'), and use that to construct the OSS URL. This is semi-correct, unless you work with aliyun CDN which use your domain as MEDIA_URL (for example, MEDIA_URL = 'https://files.yourdomain.com/').

Proposal,

  • Add settings.OSS_MEDIA_LOCALTION = '/media/'
  • Add settings.OSS_STATIC_LOCALTION = '/static/'
  • For private acl bucket, use signed_url
  • For public / public-read acl buckets, use MEDIA_URL or STATIC_URL when available, otherwise fallback to standard oss url.

The pull request #16 is based on pull request #10 from @jxltom, which added public, public-read acl support.

@favoyang favoyang changed the title Proposal to make django-oss-storage works with aliyun CDN Proposal to make django-oss-storage work with aliyun CDN May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant