Changes between Version 3 and Version 4 of Ticket #33955


Ignore:
Timestamp:
Aug 24, 2022, 2:24:01 PM (20 months ago)
Author:
Greg Kaleka
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33955 – Description

    v3 v4  
    44
    551. Create a new project with Django 4.1
    6 2. Include `django.contrib.admindocs` in your installed apps
    7 3. Add the urls to your urlconf: `path("admindocs/", include("django.contrib.admindocs.urls"))`
    8 4. Go to `localhost:8000/admindocs/views/` and click on any view to go to the `ViewDetailView`
     62. Run `manage.py migrate` and `manage.py createsuperuser`
     73. Include `django.contrib.admindocs` in your installed apps
     84. Add the urls to your urlconf: `path("admindocs/", include("django.contrib.admindocs.urls"))`
     95. Go to `localhost:8000/admindocs/views/` and click on any view to go to the `ViewDetailView`
    910
    1011Quick and dirty fix in `django/contrib/admindocs/utils.py`:
     
    2223  }}}
    2324}}}
    24 
    25 and here's the full traceback before the fix:
    26 
    27 {{{
    28 Internal Server Error: /admindocs/views/django.contrib.admindocs.views.BaseAdminDocsView/
    29 Traceback (most recent call last):
    30   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    31     response = get_response(request)
    32   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    33     response = wrapped_callback(request, *callback_args, **callback_kwargs)
    34   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/views/generic/base.py", line 103, in view
    35     return self.dispatch(request, *args, **kwargs)
    36   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/utils/decorators.py", line 46, in _wrapper
    37     return bound_method(*args, **kwargs)
    38   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    39     return view_func(request, *args, **kwargs)
    40   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/contrib/admindocs/views.py", line 50, in dispatch
    41     return super().dispatch(request, *args, **kwargs)
    42   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/views/generic/base.py", line 142, in dispatch
    43     return handler(request, *args, **kwargs)
    44   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/views/generic/base.py", line 216, in get
    45     context = self.get_context_data(**kwargs)
    46   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/contrib/admindocs/views.py", line 185, in get_context_data
    47     view_func = self._get_view_func(view)
    48   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/contrib/admindocs/views.py", line 169, in _get_view_func
    49     if _is_callback(view):
    50   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/django/contrib/admindocs/utils.py", line 258, in _is_callback
    51     return name in _active.local_value
    52   File "/Users/gkaleka/dev/testing/django_41_testfix/.venv/lib/python3.9/site-packages/asgiref/local.py", line 105, in __getattr__
    53     raise AttributeError(f"{self!r} object has no attribute {key!r}")
    54 AttributeError: <asgiref.local.Local object at 0x10a4f7670> object has no attribute 'local_value'
    55 }}}
Back to Top