I'm creating a pretty large Django application and the whole front end works by making Javascript API calls to the back end and rendering the data, my only concern is the API I'm writing will also be used by other users from the command line or their own apps.
For front end to back end I'm just doing
if request.user.is_authenticated:
# Do shit
# Return Said shit but with JSON
How do I program in a way that this also works in a token based way? Or should every user have a default token that's used to make this API call?
How does a app like gcloud do this, I could pass objects to the django template, but I'm giving select options that make heavier API calls in the frontend. If there's a way I can move forward with this approach help will be much appreciated, and advice will be even more appreciated.