Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Integration with Django REST

I am building a mobile application on Flutter and have integrated a Firebase login to the application. I also have a Python Django REST API that is called within the app. I am hoping to integrate Firebase with the REST API so that the users in Firebase can become authenticated users of the API (and so I can create tokens and tokenize the API endpoint).

Does anyone know of a method I can use for this? Novice programmer and new to Firebase so let me know if there is a better way to do this! Appreciate the help.

like image 805
PJQuakJag Avatar asked Sep 20 '18 15:09

PJQuakJag


People also ask

Can I use REST API with Firebase?

We can use any Firebase Realtime Database URL as a REST endpoint. All we need to do is append . json to the end of the URL and send a request from our favorite HTTPS client.

Can I host Django on Firebase?

You can upload dynamic or static content on firebase, in the case of a Django app it's dynamic but your stylesheets / scripts are static content. Then in your server you have to specify that all the static files are stored in the above path.

Can Django be used for REST API?

Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: The Web browsable API is a huge usability win for your developers.


1 Answers

The Firebase docs explain this well, if you check out the following URL: https://firebase.google.com/docs/auth/admin/verify-id-tokens . I started a Django app to handle this myself which you can download from PyPi: drf-firebase-auth, which you can either use yourself or fork the repo and adjust as suitable to your needs.

like image 69
Gary Burgmann Avatar answered Oct 03 '22 21:10

Gary Burgmann