pinax-messages icon indicating copy to clipboard operation
pinax-messages copied to clipboard

Django 4.0 Support

Open ICSGrade opened this issue 3 years ago • 10 comments

Currently there are two items in the pinax-messages that are depreciated in Django 4.0/4.1.

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'pinax.messages' defines default_app_config = 'pinax.messages.apps.AppConfig'. Django now detects this configuration automatically. You can remove default_app_config. app_config = AppConfig.create(entry)

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pinax/messages/signals.py:3: RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement. If you rely on this argument as documentation, you can move the text to a code comment or docstring. message_sent = Signal(providing_args=["message", "thread", "reply"]) System check identified no issues (0 silenced).

Can someone update the code to make this package work with 4.0?

ICSGrade avatar Jan 01 '22 19:01 ICSGrade

Would be great

ghost avatar Jan 02 '22 18:01 ghost

In Signals.py, you just need to change it to say:

message_sent = Signal()

I checked the rest of the code and do not believe it needed more than that to work.

default_app_config = 'pinax.messages.apps.AppConfig' should be removed as it is redundant at this point in Django 4. Hopefully one of the Devs can push out this change quickly as it is a minute of time to make these changes.

ICSGrade avatar Jan 02 '22 18:01 ICSGrade

I forked the package and made the changes so that it is now Django 4.0 compatible. Please see the following repo if you need to use the pinax-messages package with Django 4.0 https://github.com/ICSGrade/ics-pinax-messages

ICSGrade avatar Jan 05 '22 17:01 ICSGrade

File "C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\pinax\messages\urls.py", line 1, in from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\django\conf\urls_init_.py)

@ICSGrade i got this error using your build

Ladet02 avatar Jan 21 '22 16:01 Ladet02

File "C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\pinax\messages\urls.py", line 1, in from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\django\conf\urls__init__.py)

@ICSGrade i got this error using your build

Are you on Django 4.0? I’ll try and look at this later today and update the code.

ICSGrade avatar Jan 21 '22 16:01 ICSGrade

File "C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\pinax\messages\urls.py", line 1, in from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Lanre Adetoro\Desktop\Dev\Lanlod\landvenv\lib\site-packages\django\conf\urls__init__.py) @ICSGrade i got this error using your build

Are you on Django 4.0? I’ll try and look at this later today and update the code.

Yes I am.

It might interest you to look at this

https://stackoverflow.com/questions/70319606/importerror-cannot-import-name-url-from-django-conf-urls-after-upgrading-to

thanks

Ladet02 avatar Jan 21 '22 16:01 Ladet02

OK I believe this is working properly now.... Try to pip install --upgrade -e git+git://github.com/ICSGrade/ics-pinax-messages@c9bfa6f98fbcaface764ae2d996eaf7664cceb4e#egg=pinax-messages . If there are any more issues then please let me know and I can try and fix them.

ICSGrade avatar Jan 21 '22 18:01 ICSGrade

@ICSGrade I'm getting the following error when I attempt pip install --upgrade -e git+git://github.com/ICSGrade/ics-pinax-messages@c9bfa6f#egg=pinax-messages

WARNING: Discarding git+git://github.com/ICSGrade/ics-pinax-messages@c9bfa6f#egg=pinax-messages. Command errored out with exit status 128: git clone --filter=blob:none -q git://github.com/ICSGrade/ics-pinax-messages /home/henry/Documents/Sites/patch/env/src/pinax-messages Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement pinax-messages (unavailable) (from versions: 0.1, 0.2, 0.3, 1.0.0, 1.0.1, 1.2.0, 2.0.0, 2.0.1, 2.0.2, 3.0.0) ERROR: No matching distribution found for pinax-messages (unavailable)

Any thoughts?

HenryMehta avatar May 17 '22 08:05 HenryMehta

For me it installed with pip install git+https://github.com/ICSGrade/ics-pinax-messages@c9bfa6f#egg=pinax-messages

HenryMehta avatar May 17 '22 08:05 HenryMehta

#63 anyone interested?

paltman avatar Dec 03 '22 18:12 paltman