Introduction to various databases compatible with the Python Django framework, pythondjango

Source: Internet
Author: User

Introduction to various databases compatible with the Python Django framework, pythondjango

Use PostgreSQL in Django

To use PostgreSQL, You need to download the psycopg development kit from the http://www.djangoproject.com/r/python-pgsql. We recommend that you use psycopg2, because it is new, is more active in development, and is easier to install. Note that you are using version 1 or 2. You will need this information later.

If PostgreSQL is used on Windows, you can get pre-compiled psycopg Development Kit binaries from the http://www.djangoproject.com/r/python-pgsql/windows.

If you are using Linux, check whether your release package management system provides a set of packages named python-psycopg2, psycopg2-python, and python-postgresql.
Use SQLite 3 in Django

If you are using Python 2.5 or later, you are lucky: you do not need to install a specific database because Python supports communication with SQLite. Jump forward to the next section.

If you are using Python2.4 or earlier, you need SQLite 3 instead of version 2, this can be confirmed from the http://www.djangoproject.com/r/sqlite/pysqlitehttp://www.djangoproject.com/r/python-sqlite/ that your pysqlite version is 2.0.3 or higher.

On Windows, you can skip the installation of the separate SQLite Binary packages because they have been statically linked to the pysqlite binary development kit.

If you are using Linux, check whether your release package management system provides a set of packages named python-sqlite3, sqlite-python, and pysqlite.
Use MySQL in Django

Django requires MySQL4.0 or a later version. Version 3.x does not support nested subqueries and some other fairly standard SQL statements.

You also need to download and install MySQLdb from http://www.djangoproject.com/r/python-mysql.

If you are using Linux, check whether your system's package manager provides python-mysql, python-mysqldb, myspl-python, or similar packages.
Use the Oracle database in Django

Django requires Oracle9i or a later version.

If you use Oracle, you need to install the cx_Oracle database from http://cx-oracle.sourceforge.net. Use version 4.3.1 or later, but avoid version 5.0. This is because the driver of this version has a bug.
Use Django without Database Support

As mentioned before, Django does not have to run in databases. If you only use it to provide dynamic page services that do not involve databases, it can also run perfectly.

However, remember:

Some additional tools bound by Django must need databases. Therefore, if you choose not to use the database, you will not be able to use those functions. (We will emphasize these functions from beginning to end in this book)


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.