Database Configuration in django

Source: Internet
Author: User
The database configuration is in settings. in The py file, open this file and find DATABASES. The ENGINE tells Django which database ENGINE is used. Common DATABASES include PostgreSQL, MySQL, sqllite3, and oracle, however, no matter which database server you choose to use, you must download and install the corresponding database adaptation.

The database configuration is in settings. in The py file, open this file and find DATABASES. The ENGINE tells Django which database ENGINE is used. Common DATABASES include PostgreSQL, MySQL, sqllite3, and oracle, however, no matter which database server you choose to use, you must download and install the corresponding database adaptation.

The database configuration is in the settings. py file, open this file and find DATABASES,

Specifically, the ENGINE tells Django which database ENGINE is used. Common databases include PostgreSQL, MySQL, sqllite3, and oracle. However, no matter which database server is used, you must download and install the corresponding database adapter.

"NAME" indicates the NAME of the database. In the figure, the NAME of the database is django. "USER" tells Django which USER is used to connect to the database, and "PASSWORD" tells Django the PASSWORD for connecting to the USER, the HOST tells Django which database server is connected. If the database uses SQLite, the user, password, and host fields can be blank.

After the configuration is complete, enter the interactive interpreter interface through python manage. py shell and enter the following commands to test your Database Configuration:

From django. db import connection

Cursor = connection. cursor ()

If no error information is displayed, your database configuration is correct. Otherwise, you must check the error information to correct the error. common error information, as shown in:


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.