-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Dash's config system #312
Comments
This is a discussion about Dash's config system. As we add features that can be turned on and off or configured, like those in our dash dev tools system, we should make sure that we're building them on a sound configuration / settings system. In principle, I'm interested in Dash having a small, declarative API. That is, when you learn Dash, you only need to know:
The config settings are currently exposed in an ad-hoc way in config in constructor config in dash.Dash(port=8050) os.environ['dash_port'] = '8050'
dash.Dash() The arguments in the constructor will take precedence over Some other notes:
immutable config So, we'd deprecate We'd also deprecate the ad-hoc defaults, overrides, specificity So, setting
Perhaps we have a Each individual feature should have its own variable as well.
One issue with this system is "what's the default value?". It can't be We've gotten around this issue with if __name__ == '__main__':
app.run_server(debug=True) So, instead of So, perhaps we have one set of config variables that are specified in Another issue with using error messsages One argument against removing
If we deprecate
which I suppose isn't that much worse.
certain config variables would get serialized as JSON and embedded in this is the current behavior. |
What about config in a file ? |
I think this makes the most sense from the perspective of accessibility and backwards compatibility. I guess the other option could be to have a dedicated
This is a great idea, let's definitely do this!
Moving away from imperative ad-hoc setting of config feels much more elegant to me. I'm on board with this.
I have a strong preference for not introducing features that depend on Dash being run with There is also the argument that the Flask docs do not recommend using the What about setting Or example code snippets could use
I don't feel like this is that much of an issue. Another advantage of putting all config params in the Dash constructor, is that people sharing snippets on gthe forums etc are less likely to omit ad-hoc changes to config which can currently be defined anywhere in a Dash app's source code that is run at initialisation time. |
dev/debug mode has moved to a separate proposal: #383. We've also starting moving forward with "config in constructor". I'll close this down since we've settled on this pattern. |
No description provided.
The text was updated successfully, but these errors were encountered: