在生产中使用Sql Server与Django [英] Using Sql Server with Django in production

查看:153
本文介绍了在生产中使用Sql Server与Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有经验的部署一个Django应用程序与SQL Server数据库后端?我们的工作场所大量投资在SQL Server中,如果没有足够的后端,则不支持Django。



我知道mssql.django- pyodbc和django-mssql作为非正式支持的后端。这两个项目似乎只有一个人的贡献,这是一个担心,虽然贡献似乎有点规律。



有没有任何其他后端的SQL Server得到很好的支持我在这里提到的两件事是否足够好呢?你的经历是什么?

解决方案

如上所述,django-pyodbc是一个很好的方法。 PyODBC可能是Python最成熟的SQL Server库。



您唯一可能遇到的问题是,pyodbc不支持存储过程(您可以调用它们,但是您无法从中获取结果) )。你可以使用pymssql来调用它们,但是如果可能的话,我将会避免它,因为它不支持标准的DB-API接口,并且可能会发生变化。如果您需要这样做,最好的方法是直接使用 adodbapi (它包含在python win32包中,你可能会最终安装安装)。


Has anybody got recent experience with deploying a Django application with an SQL Server database back end? Our workplace is heavily invested in SQL Server and will not support Django if there isn't a sufficiently developed back end for it.

I'm aware of mssql.django-pyodbc and django-mssql as unofficially supported back ends. Both projects seem to have only one person contributing which is a bit of a worry though the contributions seem to be somewhat regular.

Are there any other back ends for SQL Server that are well supported? Are the two I mentioned here 'good enough' for production? What are your experiences?

解决方案

As has been stated, django-pyodbc is a good way to go. PyODBC is probably the most mature SQL Server library for Python there is.

The only thing you may have problems with is that pyodbc doesn't support stored procedures very well (you can call them, but you have no way to get results from them). You can call them using pymssql, but I would avoid it if at all possible as it doesn't support the standard DB-API interface and may be subject to changes. If you need to do this, your best bet is to use adodbapi directly (it's included with the python win32 package, which you'll probably end up installing anyway).

这篇关于在生产中使用Sql Server与Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆