Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

347
Visualizações
Use both Django REST framework and web sockets

I have an application built on Django. Initially, I constructed a few APIs using the Django REST API framework, which worked fine. Later, I implemented web sockets to listen to a server. I started the application server on port 5010 and the socket on which this application listens to the server is 8010. However, after implementing web sockets, my API calls started to fail(screenshot below).

enter image description here

Observation: I noticed that the API call doesn't fail after POST operation. The failure is at the point where I access the API at http://127.0.0.1:5010/subscribe/. That is, when I go to http://127.0.0.1:5010/subscribe/ in my browser, that is when I see the failure as shown in the above picture.

If I access the API http://127.0.0.1:5010/subscribe/ by deleting the code for web sockets, the API call works fine (screenshot below)

enter image description here

Please explain if using both REST API framework and web sockets would be possible in Django.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I guess you are using the wrong HTTP request in your case.

In Response header, the allowed HTTP request are POST and OPTIONS. But you are attempting to make GET request through web browser.

Try making a POST request instead.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda