geex-arts / django-jet

Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo
https://github.com/jet-admin/jet-bridge
GNU Affero General Public License v3.0
3.58k stars 772 forks source link

Logout error 405 using Jet, but logout normal without jet #525

Open hapesurya opened 9 months ago

hapesurya commented 9 months ago

Hello, this is my first time using Jet in django. And I immediately tried it on a new project, fresh, without installing any other packages first. I want to check the Jet interface first on my admin.

Before I used Jet, I was able to login and logout normally (still with the standard Django admin).

But after I activated Jet, the Django admin can login, with a nice view, but there's an error when logging out. There's a 405 error when logging out.

Has anyone else experienced the same thing?

Here's the code I wrote:

Error Debug Code: [11/Feb/2024 05:28:39] "GET /jet/jsi18n/ HTTP/1.1" 200 3342 [11/Feb/2024 05:28:39] "GET /jet/jsi18n/ HTTP/1.1" 200 3342 Method Not Allowed (GET): /admin/logout/ Method Not Allowed: /admin/logout/ [11/Feb/2024 05:28:41] "GET /admin/logout/ HTTP/1.1" 405 0

File URLS.PY

from django.contrib import admin from django.urls import path, include

urlpatterns = [ path('jet/', include('jet.urls', 'jet')), # Django JET URLS path('jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')), # Django JET dashboard URLS path('admin/', admin.site.urls), ]

File Setting.py

INSTALLED_APPS = [ 'jet.dashboard', 'jet',

'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

]

MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ]

ROOT_URLCONF = 'testjet.urls'

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ]

The rest of the code hasn't been changed because it's still a standard new project from Django. And I have tested this on two browsers, Firefox and the latest version of Edge. The result remains the same. Logout Error 405 if using Jet. But normal if without Jet.