Everyting on the internet about configuring angular and django to play nice together is garbage.
- Refer to the angular docs over any tutorial out there because everytyhing else is garbage.
- If anything mentions webpack, stop reading it, unless what you actually want is to learn about webpack.
- If anybody mentions turning off CORS or CSRF protections, screaming inside is encouraged, but if you let it you your non-technical coworkers will look at you funny.
What you need to know is the following. Angular's HTTP module will add the CSRF token if it was available. You just have to coordinate how your app will send it up with where angular looks for it. https://angular.io/guide/http#security-xsrf-protection
If you want to get the CSRF token from the webframework, (django in my case), you have to serve the front end from django. This is easy enough if you add the following to the JSON object at projects.your-dumb-project.architect.build.options
: