How to get two django rest framework to communicate with each other

990 views
Skip to first unread message

chern...@gmail.com

unread,
Jan 14, 2018, 11:42:59 PM1/14/18
to Django users

So i have 2 django project. Both have its seperated database and table. I create the django rest framework api for both project but i want both of them to communicate with each other.


In django 1 is about the social media and medical record app API. In django 2 is a clinic app API where the it is for staff of the clinic and collect user information from django 1 and to give a queue number for user that make appointment.


What im trying to do is django 2 will have a qr code for django 1 to scan. After scanning, it will ask for permission to allow their information to be share with django 2(their user information/medical record). After user allow, their information will be save to django 2 database.

For now, i just want to allow django 2 to save the user information from django 1.


Is there a way for 2 different django project to communicate with each other through the api ?

Jason

unread,
Jan 15, 2018, 8:59:31 AM1/15/18
to Django users
Since you already have DRF enabled, make a private API for both projects that will be used for inter-project communication.

Mohammad Etemaddar

unread,
Jan 15, 2018, 11:06:40 AM1/15/18
to Django users
Excuse me for giving advice for this change.
But why don't you put these two projects in one Django project as two apps?
You have two options. First you can make a ManyToMany relationship. Of course this has a problem. For example some people may not want to share his/her future information to a doctor.

There is other way also. You can copy data from one app to another one. Or one model to another.

chern...@gmail.com

unread,
Jan 15, 2018, 8:36:14 PM1/15/18
to Django users
From what i read at the django documentation, there is only combine database where user get to choose which table save to which db. As both app user table is meant for different people, django 1 is for normal user and django 2 is for staff/doctor. There is also limitation to combine database too.

Copy data from one to another ? You mean like importing data ? 
As my idea is when user scan QR code and allow user info to be share with the clinic, there will be interface where user can create appointment. If user create an appointment to the clinic, a queue number will be generated and given. 

There hasnt been much info i can find only regarding how 2 app to interact with each other. Is it possible to also provide link about how to do it ?

As for the private API, isnt it just by setting permission for each API ? I am not sure how that will help me.

chern...@gmail.com

unread,
Jan 15, 2018, 10:59:45 PM1/15/18
to Django users
Ok, maybe i'm confuse about this whole thing. 

So these are my task
- Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different port
- Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different database
- Integration of django 1 api and django 2 api, on django api method on django 1 api, code to POST BookAppt
- Integration of django 1 api and django 2 api, on django api method on django 2 apiI, code to GET BookAppt
- Integration of django 1 api and django 2 api, on django api method, connect to another API

May anyone please explain to me about connect to another api ? From my understanding, it is API connect to another API.Which allow django 1 api to POST to BookAppt and django 2 api to GET the data.

shreekant bohra

unread,
Jan 16, 2018, 12:34:01 AM1/16/18
to django...@googlegroups.com
You can use same database for both applications, so you don't have to worry about the API and interacting with each other.


--
Shree Kant Bohra
Co-founder
Geekybuddha Technologies




--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c6589e9c-662c-4204-91ae-fe30ac2711f1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

chern...@gmail.com

unread,
Jan 16, 2018, 2:58:56 AM1/16/18
to Django users
Oh, but the thing is i am doing 1 project, and another person is doing other part of the project. And we have to integrate with each other. So we each have our own db. 


On Tuesday, January 16, 2018 at 2:34:01 PM UTC+9, Shree Kant Bohra wrote:
You can use same database for both applications, so you don't have to worry about the API and interacting with each other.


--
Shree Kant Bohra
Co-founder
Geekybuddha Technologies




On Tue, Jan 16, 2018 at 9:29 AM, <chern...@gmail.com> wrote:
Ok, maybe i'm confuse about this whole thing. 

So these are my task
- Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different port
- Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different database
- Integration of django 1 api and django 2 api, on django api method on django 1 api, code to POST BookAppt
- Integration of django 1 api and django 2 api, on django api method on django 2 apiI, code to GET BookAppt
- Integration of django 1 api and django 2 api, on django api method, connect to another API

May anyone please explain to me about connect to another api ? From my understanding, it is API connect to another API.Which allow django 1 api to POST to BookAppt and django 2 api to GET the data.

On Monday, January 15, 2018 at 1:42:59 PM UTC+9, chern...@gmail.com wrote:

So i have 2 django project. Both have its seperated database and table. I create the django rest framework api for both project but i want both of them to communicate with each other.


In django 1 is about the social media and medical record app API. In django 2 is a clinic app API where the it is for staff of the clinic and collect user information from django 1 and to give a queue number for user that make appointment.


What im trying to do is django 2 will have a qr code for django 1 to scan. After scanning, it will ask for permission to allow their information to be share with django 2(their user information/medical record). After user allow, their information will be save to django 2 database.

For now, i just want to allow django 2 to save the user information from django 1.


Is there a way for 2 different django project to communicate with each other through the api ?

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Avraham Serour

unread,
Jan 16, 2018, 6:21:29 AM1/16/18
to django-users
This shouldn't be a problem, I work with several people on the same django app.
We use git to share the code. you can use a hosted git service like gitlab, github or bitbucket


To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages