Multiple database support in django

后端 未结 10 2127
囚心锁ツ
囚心锁ツ 2020-12-31 11:44

From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet.

Can anyone please tell

10条回答
  •  清酒与你
    2020-12-31 12:35

    I think you will have to resort to "raw sql" .. kinda thing ..
    look here: http://docs.djangoproject.com/en/dev/topics/db/sql/

    you need a "connection" to your other database, if you look at django/db/__init__.py around line 39 (in my version ..)

    connection = backend.DatabaseWrapper(**settings.DATABASE_OPTIONS)

    try to take it from there ..
    P.S. I haven't really tried this or anything .. just trying to point in the general direction of what I think might solve your problem.

提交回复
热议问题