question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'dict' object has no attribute 'getlist'

See original GitHub issue

when using django-debug-toolbar = 3.1 version I get error

Traceback (most recent call last):
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/sentry_sdk/integrations/django/middleware.py", line 134, in call
    return f(*args, **kwargs)
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/sentry_sdk/integrations/django/middleware.py", line 90, in sentry_wrapped_method
    return old_method(*args, **kwargs)
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/debug_toolbar/middleware.py", line 67, in call
    panel.generate_stats(request, response)
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/debug_toolbar/panels/request.py", line 30, in generate_stats
    "post": [(k, request.POST.getlist(k)) for k in sorted(request.POST)],
  File "/home/folt/env_work/temes-Yu7Jpmcx-py3.7/lib/python3.7/site-packages/debug_toolbar/panels/request.py", line 30, in <listcomp>
    "post": [(k, request.POST.getlist(k)) for k in sorted(request.POST)],
AttributeError: 'dict' object has no attribute 'getlist'

when using django-debug-toolbar = 2.0 version everything works correctly

[tool.poetry.dependencies]
python = "3.7.8"

django = "^2.2.11"
django-split-settings = "^1.0"
django-feature-policy = "^3.5"

psycopg2 = "^2.8"
gunicorn = "^20.0"
python-decouple = "^3.3"
bcrypt = "^3.2"
structlog = "^20.1.0"
importlib-metadata = "^2.0.0"
django-redis = "^4.12.1"
django-oauth-toolkit = "^1.3.2"
raven = "^6.10.0"
mysqlclient = "^2.0.1"
djongo = "^1.3.3"
djangorestframework = "^3.12.1"
django-filter = "^2.4.0"
django-constance = {extras = ["redis"], version = "^2.7.0"}
celery = "^5.0.1"
firebase-admin = "^4.4.0"
ujson = "^4.0.1"
cryptography = "^3.1.1"
jsonfield = "^3.1.0"
django-threadlocals = "^0.10"
polyline = "^1.4.0"
geopy = "^2.0.0"
clickhouse-driver = "^0.1.5"
AMQPStorm = "^2.8.2"
sentry-sdk = "^0.19.1"
django-phonenumber-field = {extras = ["phonenumbers"], version = "^5.0.0"}
django-extensions = "^3.0.9"
django-sslserver = "^0.22"
drf-yasg2 = "^1.19.3"
tqdm = "^4.50.2"
python-dateutil = "^2.8.1"
uWSGI = "^2.0.19"
django-ipware = "^3.0.2"
geoip2 = "^4.1.0"


[tool.poetry.dev-dependencies]
django-debug-toolbar = "^2.0"
django-querycount = "^0.7"
django-coverage-plugin = "^1.8"
nplusone = "^1.0"

wemake-python-styleguide = "^0.14"
flake8-pytest-style = "^1.3"
flake8-django = "^1.1"
flake8-logging-format = "^0.6"
nitpick = "^0.23"

pytest = "^6.1"
pytest-django = "^3.10"
pytest-cov = "^2.10"
pytest-randomly = "^3.4"
pytest-deadfixtures = "^2.2"
pytest-testmon = "^1.0"
pytest-timeout = "^1.4"
hypothesis = "^5.37"

mypy = "^0.770"
django-stubs = "^1.4"

ipython = "^7.18"

sphinx = "^2.4"
sphinx-autodoc-typehints = "^1.10"
doc8 = "^0.8"

yamllint = "^1.25"
safety = "^1.9"
dotenv-linter = "^0.1"
polint = "^0.4"
dennis = "^0.9"
dump-env = "^1.2"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
foltcommented, Dec 1, 2020

Thanks!

By the way, if you wanted feedback from the community you should wait a bit before merging your own pull requests. Jazzband of course allows you to do this. But, as always, with power comes responsibility.

(FWIW I think the solution is fine, I would only have had cosmetic suggestions.)

I don’t often send contributions anywhere, and not too long ago to Jazzband. Right now this contribution is burning for me because this error breaks my project. But in the future I will not be in such a hurry. Thanks.

0reactions
matthiaskcommented, Dec 1, 2020

Thanks!

By the way, if you wanted feedback from the community you should wait a bit before merging your own pull requests. Jazzband of course allows you to do this. But, as always, with power comes responsibility.

(FWIW I think the solution is fine, I would only have had cosmetic suggestions.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django 'dict' object has no attribute 'getlist' - Stack Overflow
Inspired by this blog post, I am trying to make a views that handles profiles searches by saving the search parameters into session...
Read more >
AttributeError: 'dict' object has no attribute 'getlist' when calling ...
Hello! when i try to call hours/ i get the following error. Calling hours/xy works as expected. Trac detected an internal error: AttributeError:...
Read more >
AttributeError: 'dict' object has no attribute in Python | bobbyhadz
The "AttributeError: 'dict' object has no attribute" means that we are trying to access an attribute or call a method on a dictionary...
Read more >
Passing an empty QueryDict to a form stores it as a plain ...
FILES is empty # AttributeError: 'dict' object has no attribute 'getlist'. Instead of self.data = data or {} self.files = files or {}....
Read more >
How do I write a test for a custom update that uses getlist?
I am getting "AttributeError: 'dict' object has no attribute 'getlist'". The crux of the problem seems to be that in a real request, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found