question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'DatabaseWrapper' object has no attribute 'is_mariadb'

See original GitHub issue

When i am running the makemigration command for this model

from __future__ import unicode_literals

from django.db import models
from django_mysql.models import JSONField

class Owners(models.Model):
    name = models.CharField(max_length=255)
    url = models.CharField(max_length=128, null=True, blank=True)
    email = models.EmailField(null=True, blank=True)
    phone = models.CharField(max_length=32, null=True, blank=True)
    address = models.CharField(max_length=128, null=True, blank=True)
    country = models.CharField(max_length=32, null=True, blank=True)
    description = models.TextField(null=True, blank=True)

class Brands(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey(Owners, null=True, blank=True)
    url = models.CharField(max_length=128, null=True, blank=True)
    description = models.TextField(null=True, blank=True)
    tags = JSONField(null=True, blank=True)

I am getting that logs

  File "/home/sanyam/Project/groceryfy/venv/local/lib/python2.7/site-packages/django_mysql/models/fields/json.py", line 65, in _check_mysql_version
    (conn.is_mariadb or conn.mysql_version < (5, 7))
AttributeError: 'DatabaseWrapper' object has no attribute 'is_mariadb'

Summary: summarize the issue here

If this is a bug, please fill in the below, else delete

Django Version: e.g. Django 1.9

Database and version used: e.g. MySQL 5.7

Version: e.g. Django-MySQL 1.1.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
adamchainzcommented, Oct 12, 2016

I suspect you don’t have django_mysql in your INSTALLED_APPS, as previously reported and will be fixed in #323 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'DatabaseWrapper' object has no attribute ...
My issue was that I had used django.db.backends.postgresql_psycopg2 instead of django_tenants.postgresql_backend for my database engine as ...
Read more >
'db.backends.dummy.base.DatabaseWrapper' object has no ...
I am getting a AttributeError: 'DatabaseWrapper' object has no attribute 'Database' exception, while trying to setup/use py.test with Django.
Read more >
'DatabaseWrapper' object has no attribute 'Database' – iTecNote
Python – AttributeError: 'DatabaseWrapper' object has no attribute 'Database'. djangopython. Version numbers are Django 1.6, Python 3.3.2 and Mac OS X 10.9.
Read more >
django+mysql='DatabaseWrapper' object has no attribute ...
Coding example for the question django+mysql='DatabaseWrapper' object has no attribute 'Database' error-django.
Read more >
'DatabaseWrapper' object has no attribute 'pattern_ops ...
pattern = connection.pattern_ops[self.lookup_name].format(connection.pattern_esc). AttributeError: 'DatabaseWrapper' object has no attribute 'pattern_ops'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found