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:
- create django app, , use tastypie/drf can produce api.
- use djangular create new app
manage.py startangularapp <app_name>, gives base layout including angular. - define 'passthrough' url each app, in urls.py points index.html each app, minimum contains
<div ng-view></div>. - in
app.jsprovide routes using$routeprovider. you'll need injectdjangopropertiesin dependencies, , usedjangoproperties.static_urlright path. - write service consumes api
1. - write rest of angularjs app around api
- share , enjoy!
Comments
Post a Comment