N
N
Nikita Roschenko2015-08-12 10:34:09
Django
Nikita Roschenko, 2015-08-12 10:34:09

How to use Django in a third party application?

I recently started learning django, I really liked its implementation of models.
Now I'm trying to create such an application, on the front (CRUD / Admin / Statistics / etc ..) I want to use django, and in the backend (Permanently running application that works via api with other servers) I will use regular scripts.
And so I came to the conclusion that it would be very cool to use models to work with the database in the backend application, so to speak, one code.
Is it possible to somehow access working django models from a normal python script?
Or maybe I should choose another interaction?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
un1t, 2015-08-12
@Avillions

Is it possible to somehow access working django models from a normal python script?

It is possible, but it's kind of a strange decision. Maybe it's worth doing a backend on a dazhnge?
And as an option, look at https://docs.djangoproject.com/en/1.8/howto/custom...

V
Vadim Shandrinov, 2015-08-12
@suguby

We have this: there are two applications in dzhanga - front and back. They are on different servers. From the front, you sometimes need to climb into the back database. Both projects under mercurial made a sub-repo, in which they put back models that need access from the front. When developing, we finish the backing, commit, go to the front code, pull up a new version of the subrep, embed, commit, release. Yes, from the front we go through .using () - we wrote a simple manager - and settings in settings for the remote database.
Not to say that a simple solution, but possible.
As an alternative, there was some kind of API (rpc, http) but it is more difficult to maintain, kmk.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question