PhoebeB
PhoebeB

Reputation: 8570

Best approach to send data from one django app to another

When Django App A completes an action I want it to add some data to Django App B. They are currently on different domains but the same server.

Option 1.

I've tried doing POST requests both with jQuery and using python-requests but in both instances the POST is converted to a GET. Suspect this a cross-domain issue and have applied the cross-domain middleware and the various changes to the headers suggested but still not cracked it. Is this the best approach to pursue?

Option 2

I could set up a shared database so A writes to it and B reviews it and picks up the data. This seems very clunky.

Option 3

Some sort of messaging/queueing system. Redis? Celery? From a read of the documentation it is not immediately obvious to me how I implement the setup I need.

Option X Another approach?

Upvotes: 1

Views: 327

Answers (1)

Glyn Jackson
Glyn Jackson

Reputation: 8354

Option 1: Try a webservice API framework for Django like TastyPie. JSON was designed for data interchange, it allows completely different systems to talk.

Option 2: Don't duplicate data. There is nothing wrong with both apps accessing the same database, infact this makes perfect sense.

Option 3 Option 3 makes little sense for what you are trying to do.

Upvotes: 1

Related Questions