Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
15592a04
Kaydet (Commit)
15592a04
authored
Kas 11, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1906 from DanSears/master
Added description of MySQL Connector/Python
üst
dbbd10e7
a17fc362
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
14 deletions
+47
-14
databases.txt
docs/ref/databases.txt
+47
-14
No files found.
docs/ref/databases.txt
Dosyayı görüntüle @
15592a04
...
...
@@ -237,11 +237,38 @@ running ``migrate``::
had reports that the Windows Community Server installer sets up InnoDB as
the default storage engine, for example.
.. _mysql-db-api-drivers:
MySQL DB API Drivers
--------------------
The Python Database API is described in `PEP 249`_. MySQL has two prominent
drivers that implement this API:
.. _PEP 249: http://www.python.org/dev/peps/pep-0249/
- `MySQLdb`_ is a native driver that has been developed and supported for over
a decade by Andy Dustman.
- `MySQL Connector/Python`_ is a pure Python driver from Oracle that does not
require the MySQL client library or any Python modules outside the standard
library.
.. _MySQLdb: https://pypi.python.org/pypi/MySQL-python/1.2.4
.. _MySQL Connector/Python: http://dev.mysql.com/downloads/connector/python
Both drivers are thread-safe and both provide connection pooling. The major
difference is that MySQL Connector/Python supports Python 3.
In addition to a DB API driver, Django needs an adaptor to access the database
drivers from its ORM. Django provides an adaptor for MySQLdb while MySQL
Connector/Python includes `its own`_.
.. _its own: http://dev.mysql.com/doc/refman/5.6/en/connector-python-django-backend.html
MySQLdb
-------
~~~~~~~
`MySQLdb`_ is the Python interface to MySQL. Version 1.2.1p2 or later is
required for full MySQL support in Django.
Django requires MySQLdb version 1.2.1p2 or later.
.. note::
If you see ``ImportError: cannot import name ImmutableSet`` when trying to
...
...
@@ -253,25 +280,31 @@ required for full MySQL support in Django.
.. note::
There are known issues with the way MySQLdb converts date strings into
datetime objects. Specifically, date strings with value 0000-00-00 are
valid for
MySQL but will be converted into None by MySQLdb.
datetime objects. Specifically, date strings with value 0000-00-00 are
valid for
MySQL but will be converted into None by MySQLdb.
This means you should be careful while using loaddata/dumpdata with rows
that may have 0000-00-00 values, as they will be converted to None.
.. _MySQLdb: http://sourceforge.net/projects/mysql-python
.. note::
At the time of writing, the latest release of MySQLdb (1.2.4) doesn't
support Python 3. In order to use MySQLdb under Python 3, you'll have to
install an unofficial fork, such as `MySQL-for-Python-3`_.
Python 3
--------
This port is still in alpha. In particular, it doesn't support binary
data, making it impossible to use :class:`django.db.models.BinaryField`.
At the time of writing, the latest release of MySQLdb (1.2.4) doesn't support
Python 3. In order to use MySQL under Python 3, you'll have to install an
unofficial fork, such as `MySQL-for-Python-3`_.
.. _MySQL-for-Python-3: https://github.com/clelland/MySQL-for-Python-3
This port is still in alpha. In particular, it doesn't support binary data,
making it impossible to use :class:`django.db.models.BinaryField`.
MySQL Connector/Python
~~~~~~~~~~~~~~~~~~~~~~
.. _MySQL-for-Python-3: https://github.com/clelland/MySQL-for-Python-3
MySQL Connector/Python is available through two `release branches`_: Generally
Available (GA, currently 1.0.x) and Development (Dev, currently 1.1.x).
The Django adapter is currently available in the Dev branch and is described
as Alpha.
.. _release branches: http://dev.mysql.com/downloads/connector/python/
Creating your database
----------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment