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

Pass config files #38

Open
ghost opened this issue Jul 24, 2018 · 3 comments
Open

Pass config files #38

ghost opened this issue Jul 24, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 24, 2018

I guess this is more of a feature request than a but. For modules that require a config (e.g. those that do API calls), how to pass those configurations?

I tried to include a config file manually in my env, and also tried adding the config directly in the notebook, but it doesn't seem to be a supported feature.

@pprzetacznik
Copy link
Owner

@rparcus could you give me some examples of such modules where external config file is needed? That would give me bigger insight into that problem.

@ghost
Copy link
Author

ghost commented Jul 25, 2018

A few examples would be https://hex.pm/packages/extwitter or https://hex.pm/packages/ex_twilio which require a config file to set the API keys.

@pprzetacznik
Copy link
Owner

pprzetacznik commented Jan 9, 2019

@rparcus from what I understand you can easily run Jupyter with installed IElixir in it with following line:

$ TWITTER_CONSUMER_KEY=MYCONSUMERKEY101 TWITTER_CONSUMER_SECRET=MYSECRETKEY101 jupyter notebook

and after that you can configure your ExTwitter in the Jupyter notebook by evaluating:

ExTwitter.configure(
  consumer_key: System.get_env("TWITTER_CONSUMER_KEY"),
  consumer_secret: System.get_env("TWITTER_CONSUMER_SECRET"),
  access_token: access_token.oauth_token,
  access_token_secret: access_token.oauth_token_secret
)

You can always grab your environment variables set in bash using System.get_env/1 function.

Sorry for not answering the question for so long time.

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

1 participant