-
Notifications
You must be signed in to change notification settings - Fork 520
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
Third party APIs #153
Comments
@elias-ebrahimpour Hello 👋 Perhaps, the best way to illustrate our approach is within our Styleguide Example - https://github.com/HackSoftware/Django-Styleguide-Example/blob/master/styleguide_example/integrations/aws/client.py We tend to write "clients" for everything that goes outside the system, and then, interact with those clients in the service layer and/or task layer, whenever is necessary. Yet, the most important thing for those clients is to define an interface for interaction with something outside of our current & existing system. Let me know if this answers your questions and you need me to put few more sentences together. Cheers! |
@RadoRado Thank you for your response and time. Cheers! |
@RadoRado Hi! For example, I have 2 applications: I need to fetch data from a third party API once a day and save. In which application is it better to add logic? I think I need to add the client in |
@devmitrandir This is how I think about it:
That's basically all there is. The general idea for the Now, I'd argue if you only need to make one But usually, there are credentials & error handling in play and it's good to live outside your domain. Again, this is a good example for me - https://github.com/HackSoftware/Django-Styleguide-Example/blob/master/styleguide_example/integrations/aws/client.py @elias-ebrahimpour this may also be helpful for you too. |
@RadoRado |
Hello and greetings,
I have a question for which I did not find a suitable answer.
In most of my projects, we had some third-party services or APIs to call (with
requests
orhttp.client
).Where do I have to put them? In the services file/folder or selectors, or anywhere else?
Finally, thanks for this good style guide.
The text was updated successfully, but these errors were encountered: