Open natehouk opened 1 year ago
Same thing happens if I try to access the change_password page:
Environment:
Request Method: GET
Request URL: http://localhost:3000/iommi-admin/change_password/
Django Version: 4.2.4
Python Version: 3.11.4
Installed Applications:
['whitenoise.runserver_nostatic',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'django.contrib.admin',
'django.forms',
'crispy_forms',
'crispy_bootstrap5',
'allauth',
'allauth.account',
'allauth.socialaccount',
'django_celery_beat',
'rest_framework',
'rest_framework.authtoken',
'corsheaders',
'drf_spectacular',
'django_unicorn',
'iommi',
'epsilon.users',
'epsilon.label',
'debug_toolbar',
'django_extensions']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'corsheaders.middleware.CorsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'iommi.live_edit.Middleware',
'iommi.sql_trace.Middleware',
'iommi.profiling.Middleware',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/debug_toolbar/middleware.py", line 69, in __call__
panel.generate_stats(request, response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/debug_toolbar/panels/headers.py", line 49, in generate_stats
self.response_headers = dict(sorted(response.items()))
^^^^^^^^^^^^^^
Exception Type: AttributeError at /iommi-admin/change_password/
Exception Value: 'ChangePasswordPage' object has no attribute 'items'
One thing to note... if I login and authenticate to a superuser account using the normal admin login page (http://localhost:3000/admin/) and then access the iommi admin page (http://localhost:3000/iommi-admin/) then it works and I am logged in.
However, if I logout, and then try to access the iommi admin page again (http://localhost:3000/iommi-admin/) then I get the same error from above:
Looks like you are missing 'iommi.middleware'
in MIDDLEWARE
.
I had to remove iommi.middleware
in MIDDLEWARE
because I a have Django configured with ATOMIC_REQUEST=True
in order to use database transactions. I removed the middleware at the request of this exception from Iommi:
'The iommi middleware is unable to retain atomic transactions. Disable ATOMIC_REQUEST for database connections (<database>) or remove middleware and use the @iommi_render decorator on the views instead.'
Therefore, I removed iommi.middleware
and use the @iommi_render
decorator on the views as instructed.
Is this configuration not compatible with the built in Iommi Admin?
Seems not.. @jlubcke do you have some comment on this? As this feature is something you use.
We use it, but not the login/logout parts. I should be an easy fix I think.
I am receiving the following error when accessing the admin page:
It appears the LoginPage is not returning a proper HttpResponse. I am not sure how to troubleshoot this further. Any ideas?