[Fixed]-Separate Angular and Django on AWS (while still having a convenient local dev environment)

1👍

Splitting the two is quite straight forward.
Just move all the angularjs code into a separate directory structure and setup the angularjs package as a normal angularjs package. There is an example on the angularjs page: https://docs.angularjs.org/tutorial/step_00.

You can just open the index.html in you browser and everything should work.

OR (this is what I’m normally doing) you serve the angularjs app using a webserver. I’m working on osx which has apache2 pre-installed.

The only thing you will have to change is the authentication which will no longer work once you are serving the angularjs app from a different url.

You can solve this by moving to Token based authentication (make sure to use https in production).

Some guidance can be found here:

Authorization header in AngularJS not working

but there are many more hints to be found on stack overflow so just search stack overflow if you get stuck.

Leave a comment