#Django API without DRF What are the consequences

4 messages · Page 1 of 1 (latest)

proper locust
#

I'm not sure what might go wrong when I have to integrate a django API (built using JsonResponse and without extra frameworks) with a frontend, in this case, Next.js.

I built a django API using JsonResponse (void of DRF). I want to build a frontend client with Next.js that would make API calls to my django API. My questions are:

Will I have to run both django and next.js servers at the same time to execute the full project?
I think I would face some challenge with csrf token, what other challenges may I face having built my API without an API framework as Django Rest Framework?

viral acorn
#

You shouldn't need a next.js server. You will need something to compile the JS, bundle it and host it somewhere. Then you'll need something to serve that. You could write a lot of that into your Django project or have a separate project. I hope that helps answer your question about a django server and a next.js server.

Regarding not using DRF: anything that DRF provides out of the box, you'll need to implement yourself. That's the main consequence.

#

Building your own API framework could make it more difficult for other djangonauts to come in an help. DRF is like django in that it's a common denominator. Using these libraries gives us common language and components, making it easier to reason about how things work.

proper locust
#

Hmmm... DRF makes us speak a common language there.
Thank you! This is helpful.