M
M
maksam072021-04-09 15:32:38
Django
maksam07, 2021-04-09 15:32:38

How to connect to another DBMS?

Good afternoon!
Tell me, please, there is such a situation:
There is a Django site that works with postgresql, but I needed to unload data from a table stored in mysql on a certain page of the site.
What functions can I connect to a muscle and what do I need to consider?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-04-09
@maksam07

https://docs.djangoproject.com/en/3.1/topics/db/mu...

1
1998or2, 2021-04-12
@1998or2

DATABASES = {
    'default': {
        'NAME': 'app_data',
        'ENGINE': 'django.db.backends.postgresql',
        'USER': 'postgres_user',
        'PASSWORD': 's3krit'
    },
    'users': {
        'NAME': 'user_data',
        'ENGINE': 'django.db.backends.mysql',
        'USER': 'mysql_user',
        'PASSWORD': 'priv4te'
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question