SQLAlchemy and django, is it production ready?

后端 未结 5 978
鱼传尺愫
鱼传尺愫 2020-12-04 22:25

Has anyone used SQLAlchemy in addition to Django\'s ORM?

I\'d like to use Django\'s ORM for object manipulation and SQLalchemy for complex

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 22:55

    I don't think it's good practice to use both. You should either:

    1. Use Django's ORM and use custom SQL where Django's built-in SQL generation doesn't meet your needs, or
    2. Use SQLAlchemy (which gives you finer control at the price of added complexity) and, if needed, use a declarative layer such as Elixir to make life a little easier.

    Of course, if you need Django's admin, then the first of these approaches is recommended.

提交回复
热议问题