Skip to content
Advertisement

Python Django REST Infinite Recursion Problem

As of late I’ve started working towards learning REST Api with Django Rest Framework, Cors headers, and mssql connector both for personal purposes, and for a project I’m working on. Beneath I’ll include snippets of code and or the errors I got to make this easier to digest.

JavaScript

Working with this project, I got close to completing a Get/Post/Put method, but once I attempted to run the server itself, it ended in an endless recursion. I’ve attempted to search a variety of threads but I’m quite unsure what the problem may be.

JavaScript

In order are the main url.py document, models.py, serializer.py, url.py within my app, and my view. Note these are all in different files, not a single file. As for the major imports I’m using Django 4.0, Django-cors-headers, DjangoRestFramework and MSSQL-Django.

If you need more information, or find the error. Let me know and I’ll respond as quickly as possible.

Advertisement

Answer

It looks like you are including BingeWatcherApp.urls inside itself. This is what leads to the error

Advertisement