18๐
Based on the comments, youโre running Django 4.0 with an old version of AllAuth. So you just need to update AllAuth and should be fine.
However, other people who have upgraded AllAuth and are running Django 4.0 but still seeing this error may have custom AllAuth or other signals registered that include the providing_args
argument.
In this case, you need to search your project for any signals (such as those often overridden in AllAuth: user_logged_in
or email_changed
) and remove the providing_args=['request', 'user', 'signup']
or other variation from the Signal
parenthesis.
See below for more information, and an example diff showing how you could move each providing_args
argument to a commented line.
Django deprecated the ability to use the providing_args
argument to django.dispatch.Signal
in Django 3.1. See bullet in the Misc section of the 3.1 release notes.
It was removed because this argument doesnโt do anything other than act as documentation. If that seems strange, it is because it is strange. Arguments should indicate data getting passed. This is probably why it was deprecated.
Django 4.0 went ahead and removed this altogether, making any code that calls Signal()
with the providing_args
argument now trigger the TypeError you encountered:
TypeError: Signal.__init__() got an unexpected keyword argument 'providing_args'
AllAuth removed the use of this argument in September of 2020. (See original report on this issue here and the referenced diff)
The person asking the question in this thread was running AllAuth 0.42.0
which does not include this change and is thus incompatible with Django 4.0.
As of today, the last version of Django AllAuth 0.42.0
is compatible with is Django 3.2.9.
7๐
I solved the same problem by replacing
check_request_enabled = Signal(providing_args=["request"])
to
check_request_enabled = Signal("request")
and now its working perfectly.
- Error loading MySQLdb module: No module named 'MySQLdb'
- Django order_by a property
- Running multiple sites on the same python process
- Django-allauth: how to properly use email_confirmed signal to set user to active
- There is no South database module 'south.db.postgresql_psycopg2' for your database django
3๐
This is for anyone who faces the same issue on Django 4.0
and is not using AllAuth
.
I ran into a similar issue. However, I was not using AllAuth
.
The problem is that Django 4.0
does not have any providing_args
parameter, so the signal is declared this way.
from django.dispatch import Signal
model_delete_signal = Signal()
Now, you can send any arguments when sending the signal, which will be received in kwargs
in the receiver.
For example, I sent the following instance
argument while sending the signal in my custom delete function
model_delete_signal.send(sender='session_delete', instance=self)
and received it this way inside the receiver
@receiver(session_delete)
def delete_session(sender, **kwargs):
instance = kwargs['instance']
Note that, the solution is the same for any Django versions that donโt have providing_args
parameter in Singal()
- What's the best way to use CoffeeScript with Django if you're developing on Windows?
- Authenticate in Django without a database
- How does this Man-In-The-Middle attack work?
1๐
i donโt know why this happening but (it works on my machine) i solved the same problem by replacing
user_logged_in = Signal(providing_args=["request", "user"])
with
user_logged_in = Signal()
in /usr/local/lib/python3.9/site-packages/allauth/account/signals.py
- How can I reset a Django test database id's after each test?
- How to embed matplotlib graph in Django webpage?
- Can I cut out the string in the Django template?
1๐
You can use Signal without argument in new version of Django 4. like this
from django.dispatch import Signal, receiver
notification=Signal()
@receiver(notification)
def show_notification(sender, **kwargs):
print("sender,", sender)
print("Kwargs", kwargs)
print("Notification")
and after where you use this Signal write like this
notification.send(sender=None, request=request, user=['Sakib', 'Malik'])
1๐
There are better explanations to the question but this is what worked for meโฆ
According to Django
The purely documentational providing_args argument for Signal is deprecated. If you rely on this argument as documentation, you can move the text to a code comment or docstring.
Just comment out the following code from signals.py file in your local project storage:
user_logged_in = Signal(providing_args=["request", "user"])
# Typically followed by `user_logged_in` (unless, e-mail verification kicks in)
user_signed_up = Signal(providing_args=["request", "user"])
password_set = Signal(providing_args=["request", "user"])
password_changed = Signal(providing_args=["request", "user"])
password_reset = Signal(providing_args=["request", "user"])
email_confirmed = Signal(providing_args=["request", "email_address"])
email_confirmation_sent = Signal(
providing_args=["request", "confirmation", "signup"])
email_changed = Signal(
providing_args=[
"request", "user",
"from_email_address", "to_email_address"])
email_added = Signal(providing_args=["request", "user", "email_address"])
email_removed = Signal(providing_args=["request", "user", "email_address"])
You can find this in /usr/local/lib/python3.10/site-packages/allauth/account/signals.py
0๐
From the django documentation for django 3.1:
The purely documentational providing_args argument for Signal is deprecated. If you rely on this argument as documentation, you can move the text to a code comment or docstring.
- Configuring django settings to work with 1.4.1. Loading template error
- Selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain while executing tests in Django with Selenium
- Performance, load and stress testing in Django
- Django force password expiration
- How to mix Django, Uploadify, and S3Boto Storage Backend?
0๐
First check your signals.py
file, where you use Signal()
function
SignalName = Signal(providing_args=["request", "user"])
In Signal()
function donโt give providing_args
as parameter, give arguments like
SignalName = Signal(["request", "user"])
- How to make GET CORS request with authorization header
- Spurious newlines added in Django management commands
- Psycopg2 OperationalError: cursor does not exist
- Django queryset union appears not to be working when combined with .annotate()
- Django mysqlclient install