Reputation: 2564
I've seen some questions around this topic, though I still didn't find the answer I'm looking for.
What is the right way to implement AngularJS application to interact with django?
As I understand the plan should like:
Do I need to use django-angular at all? As probably it looks like it would be better if angular won't be integrated into django templates and it will be completely separated. Is it so?
Maybe it's a bit mixed up in my head. Though I didn't find related explanation here.
Upvotes: 1
Views: 492
Reputation: 14616
I have been using Django Rest Framework and AngularJS with success, and heres how I've done it:
You could also have Django serving the static files (AngularJS), but I believe its an unnecessarily complicated approach.
If you implement this solution, be aware of cross-CORS errors. This happens when your angularJS (from www.yourdomain.com) tries to access a service (Django Rest Framework) from another domain (api.yourdomain.com). This issue can easily be fixed using a few lines of extra server configuration (nginx example)
Upvotes: 3