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

Use Django's system check framework instead of log message #153

Open
jnns opened this issue Nov 8, 2022 · 1 comment
Open

Use Django's system check framework instead of log message #153

jnns opened this issue Nov 8, 2022 · 1 comment

Comments

@jnns
Copy link

jnns commented Nov 8, 2022

When using django-s3-storage together with Cloudflare R2 there are no public buckets. You'll need a so-called Worker to proxy the public requests to the private bucket.

In this setup, you'll need to set AWS_S3_PUBLIC_URL = <your_worker_route> and AWS_S3_BUCKET_AUTH = True. This works perfectly fine but issues a warning each time a django-admin command is used:

Using AWS_S3_BUCKET_AUTH with AWS_S3_PUBLIC_URL. Private files on S3 may be inaccessible via the public URL. See #114

I'd like to silence this particular log message and it seems to me that Django's Sytem Check Framework would be the ideal use case for this scenario. SILENCED_SYSTEM_CHECKS could then be used to silence the check for those who don't need to be reminded of it.

If you agree that this would be useful, I'd write a patch for it.

@etianen
Copy link
Owner

etianen commented Nov 12, 2022

That's not a bad shout. I'd take that PR. :)

jnns added a commit to jnns/django-s3-storage that referenced this issue Dec 9, 2022
This allows silencing the warning in case the user knows what they are
doing.

The check for AWS_S3_BUCKET_NAME is left untouched because it looks 
like even checks of level ERROR or CRITICAL can be silenced.
Raising an exception seems like the better option to me.

Closes etianen#153.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants