django-mysql
Django-MySQL extends Django's built-in MySQL and MariaDB support their specific features not available on other databases.
Decision gist · record as of 2026-08-14
Yes, if your Django project uses MySQL or MariaDB and you need database-specific optimizations or features. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and integrates cleanly with current Django versions. Install friction is minimal. If you use PostgreSQL or SQLite, this package provides no value.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django and MySQL/MariaDB as the project database; features are only available when using MySQL or MariaDB, not other database backends.
- Low install friction with a single pure-Python wheel dependency on django.
- Actively maintained with recent commits and a stable production release status across Django 4.2 through 6.0 and Python 3.9 through 3.14.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2025-09-18 (330 days) · last repo commit 2026-08-13 · 589 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 742,761 downloads/mo, #5,179 on PyPI
Alternatives
Verify before relying
pip install django-mysql
from django_mysql.models import QuerySet
from django.db import models
class MyModel(models.Model):
objects = QuerySet.as_manager()
class Meta:
db_table = 'my_table'- Whether approx_count performance gains are significant for typical table sizes in production environments.
- Compatibility guarantees with MySQL versions beyond those explicitly tested in CI.
- Performance characteristics of the MySQL upsert-based cache backend compared to standard Django cache backends.
What it is and what it does
Django-MySQL is a bridge library that unlocks MySQL and MariaDB capabilities within Django's ORM that would otherwise be unavailable. It provides QuerySet extensions for efficient pagination and approximate counting, specialized model fields like MariaDB Dynamic Columns and comma-separated fields, direct access to over 20 MySQL-specific SQL functions, and utilities for database-level operations like named locks and table management.
The package is designed for Django projects that have committed to MySQL or MariaDB and want to leverage database-specific optimizations and features. It integrates directly into Django's model and queryset layers, so usage typically involves importing custom field classes or manager methods rather than learning a separate API. The library maintains compatibility with current Django versions (4.2 through 6.0) and modern Python (3.9+), with no external compiled dependencies beyond what Django itself requires.
Use it for
- Optimize pagination on large querysets using chunked iteration instead of loading all results into memory.
- Get quick row count estimates using approx_count instead of expensive COUNT(*) queries on massive tables.
- Store semi-structured data like configuration dictionaries using MariaDB Dynamic Columns without a separate JSON column.
- Implement application-level locking on shared resources using MySQL named locks without external lock services.
- Leverage MySQL-specific functions like JSON operations or string functions directly in ORM expressions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if your Django project uses MySQL or MariaDB and you need database-specific optimizations or features.
The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and integrates cleanly with current Django versions. Install friction is minimal. If you use PostgreSQL or SQLite, this package provides no value.
Install
django-mysql on PyPI
Before you install
Low install friction with a single pure-Python wheel dependency on django. Actively maintained with recent commits and a stable production release status across Django 4.2 through 6.0 and Python 3.9 through 3.14.
Requires Django and MySQL/MariaDB as the project database; features are only available when using MySQL or MariaDB, not other database backends.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install django-mysql
from django_mysql.models import QuerySet
from django.db import models
class MyModel(models.Model):
objects = QuerySet.as_manager()
class Meta:
db_table = 'my_table'
Verify before relying
- Whether approx_count performance gains are significant for typical table sizes in production environments.
- Compatibility guarantees with MySQL versions beyond those explicitly tested in CI.
- Performance characteristics of the MySQL upsert-based cache backend compared to standard Django cache backends.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedjango |
| Maintenance | Actively maintained 330 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 742,761 / month, #5,179 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTyping :: Typed |
Evidence: django_mysql-4.19.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django mysql mariadb extensions”
- django-mysqlDjango-MySQL extends Django's ORM with MySQL and MariaDB-specific…
- PyMySQLPyMySQL is a pure-Python MySQL and MariaDB client library that…
- mariadbMariaDB Connector/Python provides a DB API 2.0-compliant interface…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also PyMySQL · peewee · mysqlclient · pony · django-jsonfield · django-cte · django-tree-queries · modelsearch · mariadb · mysql-replication