Django and Pymssql notes

Source: Internet
Author: User

(i) Installation

Django Installation: Can be downloaded to the official website, using the new version is the trend, (below 1.8 and 1.8 above, the difference is larger) but reference less official website: https://www.djangoproject.com/

Similar to the Python third-party library installation

Installation can be consulted: http://jingyan.baidu.com/article/466506580e7d29f549e5f8b6.html

Unzip the installation file into the Python installation path ... \python\lib\site-packages, and in the command line into the extracted folder: Execute command Python setup.py install.

Pymssql installation: Download the WHL file http://www.lfd.uci.edu/~gohlke/pythonlibs/on the third library #pymssql

(ii) examples

Pymssql Connection Example:

Import pymssql
conn = Pymssql.connect (host= ", user=", password= ", database=")
cur = conn.cursor ()
Cur.execute (' SELECT TOP ' from [dbo].[ Accout] ')
row = Cur.fetchone ()
Print (ROW)
Cur.close ()
Conn.close ()

Django Static Page Development example:

http://www.open-open.com/solution/view/1435818796310/

Django and Pymssql notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.