I'm trying to make an app and web together while playing django.
I'm going to use the restful method to send and receive data in the app.
But there's a thing called django restframework, but I don't know why I use it.
Shouldn't we just use the class base view in django and return it to json?
Another thing I'm curious about is that if you built an API server with restframework,
You can't even use HttpResponse or Redirect like django.shortcut.
If this is the case, do I have to code only at the front end through the server?
Or do you work on the template part and the api (json) part separately according to the header?
restful restframework django
As I said, it's actually possible to use anything like fbv or cbv if you use something like Json Response.
DRF (Django Rest Framework) provides functions such as authentication and permission, making it easier to configure restapi.
Originally, you have to configure the api and test it daily with curl or a dedicated test tool, but if you use drf, you can request and test it directly from the browser
There are people who purposely make and use the drf because it looks like a beggar.
I don't know if you're configuring the app on a page that runs on django directly, but if you're thinking of using it in an app, you have to turn off the csrf_token function
I will only use it on my homepage and it is simple => FBV, solder iron
I'm going to use the app or other people => DRF Recommended
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
578 Understanding How to Configure Google API Key
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.