Workflow for Angular/Django app development
I'm working on an app using Django & Angular. I need to build the Angular app and deploy it to be served through the Django dev server in order to use Django as the backend, and I'm wondering if there's a way to optimize the following steps:
- Building the Angular app with
ng build
- Removing the Angular files from the static files directory in my Django app
- Copying the built Angular app to the Django app static files directory
Ideally I'd like to have it done automatically on edit/save, similar to how each framework works independently. Do I have to cobble something together or is this supported already somehow? Thanks.
There are multiple ways how you can achieve this:
- Use outputPath in angular.json
- Create a shell script, which does it for you.
- If you are interested in this automatization when you deploy your app and you are using Docker, you can use Dockerfile. It is briefly documented in the last point of the article https://medium.com/@boris.haviar/serving-angular-ssr-with-django-8d2ad4e894be