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

Don't require global state #86

Open
piecommerce opened this issue Oct 25, 2013 · 1 comment
Open

Don't require global state #86

piecommerce opened this issue Oct 25, 2013 · 1 comment

Comments

@piecommerce
Copy link

The Django community has been interested in finding a way, for a while now, to remove global state from the framework. This is a good pattern to adopt in any API, in practice. For instance:

stripe = get_gateway("stripe", {"API_KEY": "???", ...})

In the above example, the get_gateway method would instantiate the gateway matching the given gateway name with the provided settings. The gateway's __init__ method would be updated to support this. If no settings were provided, the existing merchant_settings = getattr(settings, "MERCHANT_SETTINGS") would take over. The change would be fully backwards compatible.

@theju
Copy link
Contributor

theju commented Nov 5, 2013

I think this is a valid request and I think there may have been a fork [1] with someone working on it. Would you be interested in contributing a pull request?

[1] https://groups.google.com/forum/#!topic/django-merchant/ACzenR_M6j8

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

2 participants