Python's Django framework is adaptable to a variety of database introductions

Source: Internet
Author: User
Tags introductions
using PostgreSQL in Django

With PostgreSQL, you need to download the PSYCOPG package from http://www.djangoproject.com/r/python-pgsql/. We recommend using PSYCOPG2 because it is new, developing more aggressively, and easier to install. Note that you are using version 1 or 2 and you will need this information later.

If you are using PostgreSQL on the Windows platform, you can get the binaries for the precompiled PSYCOPG development package from http://www.djangoproject.com/r/python-pgsql/windows/.

If you're using Linux, check if your distribution's package management system provides a package called Python-psycopg2,psycopg2-python,python-postgresql.
Using SQLite 3 in Django

If you're using Python version 2.5 or higher, you're lucky: You don't need to install a particular database because Python supports communicating with SQLite. Jumps forward to the next section.

If you're using Python2.4 or earlier, you'll need SQLite 3 instead of version 2, which is available from http://www.djangoproject.com/r/sqlite/pysqlitehttp:// www.djangoproject.com/r/python-sqlite/confirm that your pysqlite version is 2.0.3 or higher.

On the Windows platform, you can skip individual SQLite binary package installation work because they have been statically linked to the Pysqlite binary development package.

If you're using Linux, check if your distribution's package management system provides a package called Python-sqlite3,sqlite-python,pysqlite.
Using MySQL in Django

Django requires a version of MySQL4.0 or higher. The 3.X version does not support nested subqueries and some other fairly standard SQL statements.

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

If you are using Linux, check if your system's Package Manager provides a package called Python-mysql,python-mysqldb,myspl-python or similar.
Using the Oracle database in Django

Django requires a oracle9i or later version.

If you use Oracle, you need to install the Cx_oracle library, which you can get from http://cx-oracle.sourceforge.net/. To use 4.3.1 or later, but to avoid 5.0, this is because the driver of this version has a bug.
Using Django with no database support

As mentioned before, Django doesn't have to be a database to run. It also works perfectly if you only use it to provide dynamic page services that do not involve a database.

Still, remember:

Some of the additional tools bundled with Django must require a database, so if you choose not to use the database, you will not be able to use those features. (We will emphasize these features throughout this book)

  • Related Article

    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.