pinax / pinax-messages

a Django app for allowing users of your site to send messages to each other
MIT License
202 stars 58 forks source link

Django 4.0 Support #62

Open ICSGrade opened 2 years ago

ICSGrade commented 2 years ago

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?

ghost commented 2 years ago

Would be great

ICSGrade commented 2 years ago

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 commented 2 years ago

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

Ladet02 commented 2 years ago

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

ICSGrade commented 2 years ago

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\urlsinit.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.

Ladet02 commented 2 years ago

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\urlsinit.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

ICSGrade commented 2 years ago

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.

HenryMehta commented 2 years ago

@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 commented 2 years ago

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

paltman commented 1 year ago

63 anyone interested?