Skip to content
This repository has been archived by the owner on Mar 15, 2020. It is now read-only.

Pass arbitrary WhiteNoise configuration attributes #180

Closed
florimondmanca opened this issue Mar 1, 2019 · 0 comments
Closed

Pass arbitrary WhiteNoise configuration attributes #180

florimondmanca opened this issue Mar 1, 2019 · 0 comments
Assignees
Labels
easy picker Good for newcomers enhancement New feature or improvement of an existing one third-party Related to a third-party repo or project
Milestone

Comments

@florimondmanca
Copy link
Member

florimondmanca commented Mar 1, 2019

Is your feature request related to a problem? Please describe.
Static files are served with WhiteNoise (see staticfiles.py). This library has a few configuration attributes, but there's no way to pass them down the WhiteNoise constructor: we're stuck with the default configuration.

Describe the solution you'd like
Allow to pass WhiteNoise configuration attributes when instanciating an app:

app = App(
    static_config={"max_age": 30}
)

Describe alternatives you've considered
/

Implementation ideas

  • Add **kwargs to the static (staticfiles.py) and pass them to the WhiteNoise constructor.
  • Add a whitenoise_config kwarg to App constructor, defaulting to an empty dict, and pass it to static.

Additional context
Uncovered by #179

@florimondmanca florimondmanca added easy picker Good for newcomers enhancement New feature or improvement of an existing one third-party Related to a third-party repo or project labels Mar 1, 2019
@florimondmanca florimondmanca added this to the v0.12.2 milestone Mar 1, 2019
@florimondmanca florimondmanca changed the title Passing WhiteNoise configuration attributes Pass arbitrary WhiteNoise configuration attributes Mar 1, 2019
@florimondmanca florimondmanca self-assigned this Mar 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
easy picker Good for newcomers enhancement New feature or improvement of an existing one third-party Related to a third-party repo or project
Projects
None yet
Development

No branches or pull requests

1 participant