Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting this error while running tests: 'index_together' is deprecated. Use 'Meta.indexes' in 'taggit.TaggedItem' instead. #867

Closed
mister-rao opened this issue Sep 9, 2023 · 5 comments

Comments

@mister-rao
Copy link

Getting this error while running tests:

django.utils.deprecation.RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'taggit.TaggedItem' instead. 

Versions:
Django = "4.2.5"
django-taggit = "4.0.0"

@paolodina
Copy link

  1. it's a warning, not an error (you can ignore it)
  2. ref. Django 4.2 release
  3. Fix Django warnings about index_together with new migration #862

@mister-rao
Copy link
Author

mister-rao commented Sep 19, 2023

I can run the server fine, but this is preventing me from running tests

@laymonage
Copy link

Django released 5.0 alpha two days ago, which means Django's main branch is now on 5.1 and thus index_together has been removed, hence it now becomes an error instead of a warning.

@rtpg
Copy link
Contributor

rtpg commented Sep 20, 2023

Django 5.0 has not had an official release yet, so we do not support Django 5.0 yet.

Having said that, @mister-rao you should look into warnings.filterwarnings here. It provides the way you can set up your code to ignore the warning. I stick this kind of stuff in my settings.py. The warning is fine to ignore.

@rtpg
Copy link
Contributor

rtpg commented Sep 20, 2023

Closing this now with "please use warnings.filterwarnings". A future release will remove the deprecated code (likely in conjunction with a release adding Django 5.0 support).

@rtpg rtpg closed this as completed Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants