简体   繁体   English

从 Django web 页面中的 MSSQL 数据库获取搜索结果

[英]Get results of the search from MSSQL data base in Django web page

I have to create simple Web page which will search data in a SQL Server data base.我必须创建简单的 Web 页面,该页面将在 SQL 服务器数据库中搜索数据。

I managed to connect to my database and run server with my simple HTML which has Label, textbox, button and listbox.我设法连接到我的数据库并使用我的简单 HTML 运行服务器,它具有 Label、文本框、按钮和列表框。 Expect this, project has default settings.预计这一点,项目具有默认设置。

Could you please help me, how can i set request to DB like "Select * FROM Mac_Storage where MAC = "Here should be the text from textbox"" to button and return the results to my Web page?你能帮我吗,我如何设置对数据库的请求,例如"Select * FROM Mac_Storage where MAC = "Here should be the text from textbox""按钮并将结果返回到我的 Web 页面?

I would suggest you the Django basic tutorial Django Tutorial 1 - 7 and the manage.py instpectdb command Create Models of existing database .我建议您使用 Django 基础教程Django 教程1-7 和manage.py instpectdb命令Create Models of existing database

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM