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

Storage class as a setting #202

Closed
smcoll opened this issue Jul 31, 2017 · 1 comment · Fixed by #204
Closed

Storage class as a setting #202

smcoll opened this issue Jul 31, 2017 · 1 comment · Fixed by #204

Comments

@smcoll
Copy link
Contributor

smcoll commented Jul 31, 2017

It would make sense to me that the file storage class could be selected as a configuration, especially since many deployments these day are on ephemeral file systems.

We could set storage, something like this (untested):

from django.core.files.storage import get_storage_class
from django.conf import settings

storage_class = getattr(settings, 'SILKY_STORAGE_CLASS', 'silk.models.ProfilerResultStorage')
silky_storage = get_storage_class(storage_class)()

class Request(models.Model):
    # [...]
    prof_file = FileField(null=True, storage=silky_storage)
@avelis
Copy link
Collaborator

avelis commented Jul 31, 2017

@smcoll If you have time to make a PR with this change I can take a look and merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants