mrhaoji
mrhaoji

Reputation: 336

Access other tables in the same database in Django

enter image description here

We're using two backends languages, JAVA and Python (Django), to handle different modules in the same project.

As shown above, in the database, pl_**** tables work for the JAVA part and qa_**** tables work for my Django part.

Right now, my Django part want to use the pl_user table, what should I do to access the data? Do I need add anything in the models.py? Or, do I need make some relationships between pl_user table and auth_user table?

Upvotes: 0

Views: 208

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599490

Yes, you need to define models, which inspectdb can do for you automatically. You will need to mark them as managed = False so that migrations won't be generated for them.

Upvotes: 5

Related Questions