Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing a mobile app with Ionic as the frontend and Django as the backend

I am developing a mobile app which is using Ionic (AngularJS) as the frontend and Django as the backend. I wanted to know if it is possible to use Django to expose data as a JSON web API that my app will consume through $http services. If so, how would I go about doing it?

like image 749
methuselah Avatar asked Nov 11 '15 13:11

methuselah


2 Answers

I'm doing exactly the same so YES that works nicely!

Have a look at:

http://www.django-rest-framework.org/

It will provide you with a flexible REST framework to serve your data.

On the angularjs side, I personally would use $resource instead of $http as the promises are more flexible in my opinion. Especially the chaining using $q.all() can be very useful.

Once you get to the authorization of users, have a look here:

Authorization header in AngularJS not working

on some tips on how to get django rest talking with our app.

like image 92
Niels van Eldik Avatar answered Oct 12 '22 21:10

Niels van Eldik


Have a look at this video for a great intro into using Django with Django Rest Framework and Angular:

https://www.youtube.com/watch?v=GVDjoTt3r8A

Sample app mentioned in video can be found here:

https://github.com/TrackMaven/Djangular

like image 27
Softinio Avatar answered Oct 12 '22 21:10

Softinio