[Answered ]-Django error trying to run server after installing cors-headers

0👍

Answer:

Go to your Python installation folder -> Lib -> site-packages -> corsheaders -> signal.py file. (for me it was C:\Python310\Lib\site-packages\corsheaders\signal.py)

I solved the issue by changing the file to the following:

from django.dispatch import Signal

# Return Truthy values to enable a specific request.
# This allows users to build custom logic into the request handling
check_request_enabled = Signal()

More details and smarter explanation:
https://github.com/django-notifications/django-notifications/issues/322

👤MGR4

1👍

The providing_args kwarg was removed in Django 4.0.

It’s impossible for this to happen if you have properly installed django-cors-headers 3.10.1, since this was fixed in 3.3. In addition, the line in your traceback does not exist in version 3.10.1 of the library.

  1. Make sure you don’t have multiple different versions of the library installed, e.g. one within a virtualenv and one outside it (you clearly seem to have one outside a virtualenv).
    • In fact, you seem to have two Python 3.10 installations altogether, one in AppData\Roaming\Python\Python310 and one in C:\Python310. You will want to clean that up first.
  2. If you aren’t using virtualenvs, please start using them to separate the dependencies of your different projects from one another.
👤AKX

Leave a comment