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

current setup doesn't work, new or with Wagtail #297

Open
jfmatth opened this issue Dec 11, 2024 · 3 comments
Open

current setup doesn't work, new or with Wagtail #297

jfmatth opened this issue Dec 11, 2024 · 3 comments

Comments

@jfmatth
Copy link

jfmatth commented Dec 11, 2024

Hi, very interested in this project, but out of the gate, it didn't work.

Standalone

pip install puput
django-admin startproject mysite .
python manage.py migrate 

this works, however, starting the puput instructions from https://puput.readthedocs.io/en/latest/setup.html#standalone-blog-app

Adding this to the end of mysite/settings.py

from puput import PUPUT_APPS

INSTALLED_APPS += PUPUT_APPS

Then trying to run

python manage.py migrate

Yields the error

(puput) jmatthew@PS18-4JXLYW3:~/development/wagtail/puput$ python manage.py migrate
Traceback (most recent call last):
  File "/home/jmatthew/development/wagtail/puput/manage.py", line 22, in <module>
    main()
  File "/home/jmatthew/development/wagtail/puput/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/apps/registry.py", line 116, in populate
    app_config.import_models()
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/apps/config.py", line 269, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/wagtail/admin/models.py", line 4, in <module>
    from taggit.models import Tag
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/taggit/models.py", line 185, in <module>
    class TaggedItem(GenericTaggedItemBase, TaggedItemBase):
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/db/models/base.py", line 143, in __new__
    new_class.add_to_class("_meta", Options(meta, app_label))
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/db/models/base.py", line 371, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/jmatthew/.local/share/virtualenvs/puput-DYqn5cEE/lib/python3.10/site-packages/django/db/models/options.py", line 220, in contribute_to_class
    raise TypeError(
TypeError: 'class Meta' got invalid attribute(s): index_together
(puput) jmatthew@PS18-4JXLYW3:~/development/wagtail/puput$

Looks like the taggit library is back reved and isn't compatible?

@CDWimmer
Copy link

Getting the same issue, came to the same conclusion.

The version of taggit required by this package is quite old and not compatible with Django 5.1 due to: "The model’s Meta.index_together option is removed."

This project depends on Taggit 4.0.0, which uses the offending index_together line. However Taggit 6.0.0 now exists!

It looks like Django 4.2 had some ability to smooth this over but it doesn't do anything for me in this instance - actually raises this exact error!

@CDWimmer
Copy link

CDWimmer commented Dec 15, 2024

Further info to add:
image 1
and then upon forcing pip to install django-taggit>5.0.0 to gave me this error/warning:
image

So despite setup.py specifying taggit>5.0 it apparently also requires taggit <4.1?? Either I'm drunk, Pip's drunk, or something very funky is happening in these requirements. Things seem to be working OK with taggit 6.1.0 however!

@jfmatth
Copy link
Author

jfmatth commented Dec 20, 2024

So despite setup.py specifying taggit>5.0 it apparently also requires taggit <4.1?? Either I'm drunk, Pip's drunk, or something very funky is happening in these requirements. Things seem to be working OK with taggit 6.1.0 however!

Well, I guess we're drinking the same stuff.

Thanks for the taggit 6.x tip

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

2 participants