[Django]-Select data from a database out of my django app

1👍

According to the comment you made on the other answer,

First version of our project is in php, we want to migrate to python-django and use the same old database. So we can’t create databases again and we should configure our django project to work with existing db.

You want to use an already existing legacy database in django. Django offers the possibility to create models out of your old db (legacy-databases).

Configure the db settings of your old database. Then you can run inspectdb to create django models of your old database:

python manage.py inspectdb > models.py

3👍

Django supports several databases in one instance.
Also you can manually connect to DB in your python code.
For example:

    import psycopg2
    psycopg2.connect(...)

Leave a comment