2

Now I am working with Django on server side and jQuery on client. Django views functions return templates with js code.

How it should look using AngularJS. Should I return JSON from Django and render response using JS ?

Many thanks!

3
  • What I do for my django+angular apps, I use django views to render my template but I load all my data by using ajax ($http) in angularjs Commented Mar 30, 2016 at 19:37
  • So you use django REST API and angularjs to retrieve data from server side ? Commented Mar 31, 2016 at 19:29
  • yes, you can say that Commented Apr 1, 2016 at 18:24

1 Answer 1

1

It really depends on what you want to do, there are many ways, but yeah, ideally your routes and templates are handled in AngularJS, Angular requests information from Django or POSTs information, and they communicate using JSON.

You need to put your Angular templates and files in the static folder, you can use grunt or django-pipeline to better manage all the files you have.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.