What should be my configuration to load pyodbc module on Apache Server to run simple queries mssql server database

我们两清 提交于 2019-12-02 07:47:39

You're missing several layers to your stack, which are really good ideas to learn and use if you want to leverage pyodbc:

  • Apache (installed) mod_wsgi (WSGI is a specification that describes how a web server communicates with web applications)
  • A framework to protect you from very bad things happening

However, if all you want is for that to appear on a web page, you can do it as a CGI program. This is a bad idea, but is quick and dirty.

You'll need to add this before any output (before for row):

print("Content-Type: text/html;charset=utf-8")
print()

And then follow these instructions to configure Apache to run your Python script: https://www.linux.com/blog/configuring-apache2-run-python-scripts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!