URGENT ---- Third party API integration basics

32 views
Skip to first unread message

Arpana Mehta

unread,
Aug 21, 2020, 5:55:59 AM8/21/20
to django...@googlegroups.com
Hello everybody, 
I wanted to know if there's anybody who can help me integrate a very simple third party API using client ID and secret key.

I just want to know the basic steps of where to add the key and ID in settings file so I can access that API from my app in django-project.

It's kind of urgent. Any help will be appreciated.
Many thanks,
Arpana Mehta

Ogunsanya Opeyemi

unread,
Aug 21, 2020, 6:03:29 AM8/21/20
to django...@googlegroups.com
You just need to add define the key in your settings file Key_Name= "key"
OGUNSANYA OPEYEMI


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGyqUuW-zx8-cfVt0Oq%2B3E9WwcA8w%3DgsKg3xjtC9-vvuR9pHfw%40mail.gmail.com.

RANGA BHARATH JINKA

unread,
Aug 21, 2020, 6:10:51 AM8/21/20
to django...@googlegroups.com
Hi, 

    create a variable like APIKEY = 'value' in settings.py.
    If you want to access that api key in views just use this import "from django.conf import settings"
    In views.py:
      api_key = settings.APIKEY

   All the best.



--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

Tobi DEGNON

unread,
Aug 21, 2020, 6:14:32 AM8/21/20
to django...@googlegroups.com
You add the key to your environment and read it in Django with django environ or the os module, then you can create a utils.py in the app module where you need to fetch the data, you create a function(something like fetch_api) to fetch the data and call it where you need it, you can use the requests module to make the request to your api

Arpana Mehta

unread,
Aug 21, 2020, 6:16:06 AM8/21/20
to django...@googlegroups.com
Thanks a lot for the super fast response! 🤩

Reply all
Reply to author
Forward
0 new messages