api - How to plug Angularjs / Restangular Project with Django / Tastypie? -


i'm trying shape project angularjs , restangular, web app, , django / tastypie api called app.

i have : - angular app doing when run web-server script seed app. - django / tastypie api returning json when urls called.

but don't know how connect them ! how start app django api ? how should load ? don't find many examples on web ...

many many help.

there're 2 main integration libraries, djangular , django-angular

djangular provides various scenarios, 1 makes sense me this:

  1. create django app, , use tastypie/drf can produce api.
  2. use djangular create new app manage.py startangularapp <app_name>, gives base layout including angular.
  3. define 'passthrough' url each app, in urls.py points index.html each app, minimum contains <div ng-view></div>.
  4. in app.js provide routes using $routeprovider. you'll need inject djangoproperties in dependencies, , use djangoproperties.static_url right path.
  5. write service consumes api 1.
  6. write rest of angularjs app around api
  7. share , enjoy!

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -