[Vuejs]-Getting error {"detail":"Method \"GET\" not allowed."}

0👍

Here’s the urls.py you’ve provided me in the comments:

from django.contrib import admin
from django.urls import path
from . import views

urlpatterns = [
    path('chats/', views.ChatSessionView.as_view()),
    path('chats/<uri>/', views.ChatSessionView.as_view()),
    path('chats/<uri>/messages/', views.ChatSessionMessageView.as_view()),
]

Notice how the url /api/chats/ is tied to views.ChatSessionView, not IssuesDetailsView. Yet in your Javascript you are making the request to /api/chats/.

So one way to resolve your issue is

path('chats/', views.IssuesDetailsView.as_view()),

Leave a comment