Opened 5 years ago

Closed 5 years ago

#30384 closed Bug (invalid)

Django 1.11 Upgrade -> runserver Error in db/models/fields/ _check_table_uniqueness

Reported by: Eric Neumann Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords: AttributeError: 'ModelOptions' object has no attribute 'managed'
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



I'm currently upgrading from Django 1.10 to 1.11. I've addressed all deprecation issues and everything is working fine, our app is running on gunicorn and django shell works. However, runserver is throwing an error that I can't seem to sort out. Looks like it's happening on the related groups field to the user model. We are using a custom user model which was working fine in 1.10. Below is the stack trace. Appreciate any help in getting this resolved. Cheers!

Unhandled exception in thread started by <function wrapper at 0x7f6d8b8358c0>
Traceback (most recent call last):

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/utils/", line 227, in wrapper

fn(*args, kwargs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/commands/", line 125, in inner_run


File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/", line 359, in check


File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/management/", line 346, in _run_checks

return checks.run_checks(kwargs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/checks/", line 81, in run_checks

new_errors = check(app_configs=app_configs)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/core/checks/", line 30, in check_all_models


File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/", line 1282, in check


File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/", line 1359, in _check_fields

errors.extend(field.check(from_model=cls, kwargs))

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/", line 1195, in check


File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/", line 1446, in _check_table_uniqueness

for model in self.opts.apps.get_models(include_auto_created=True)

File "/home/manzama/.virtualenvs/manzama/local/lib/python2.7/site-packages/django/db/models/fields/", line 1447, in <dictcomp>

if model != self.remote_field.through and model._meta.managed

AttributeError: 'ModelOptions' object has no attribute 'managed'

Change History (1)

comment:1 by Simon Charette, 5 years ago

Resolution: invalid
Status: newclosed

Neither Django master or 1.11.x define a ModelOptions class so I assume one of your INSTALLED_APPS is to blame.

In all cases 1.11 is currently only receiving security backports at this point and this ticket tracker is only meant to be used to report confirmed bugs and not as a second tier support channel.

Please use one of our support channels to get further assistance.

Note: See TracTickets for help on using tickets.
Back to Top