Dict object has no attribute has_key in Django
I’ve got this error when getting remote IP in Django. code: This happened when using ‘request’ to get remote IP in Django 2.0 because “has_key” has been removed in Python 3. The correct code:
I’ve got this error when getting remote IP in Django. code: This happened when using ‘request’ to get remote IP in Django 2.0 because “has_key” has been removed in Python 3. The correct code: