Best project structure for django & angularjs

I am creating a fairly large Django project for myself and want to implement AngularJS for the interface and some backend rest system. I know that the project will implement at least 7-8 of my own applications (I think that django applications should be small and be responsible for one functionality).

I have never used AngularJS before, but I want to create a good architecture. So, only one django application should have one angular application?

| - Django project
|--- app1
|------ angular_app1
|---------angular controller1
|---------angular controller2
|--- app2
|------ angular_app2
|---------angular controller1
|---------angular controller2

Or maybe I should have one global angular application for the whole project, and individual django applications should register their controllers? I think this can be useful when we want to use a module from another application.

| - Django project
|--- angular app
|--- app1
|-------angular controller1
|-------angular controller2
|--- app2
|-------angular controller3
|-------angular controller4

Or maybe I'm still wrong?

+4
2

, Django AngularJS.

DRF . , Angular Django. ,

| - Django project
    --DjangoApp1
    --DjangoApp2
    --DjangoSettingsDir
    --static
        --assets/
            --JS/
                -- controllers/
            --partials/
    --templates //base Django templates
         --index.html

index.html / Django render. Angular, UI Router, UI Bootstrap .. index.html .

+4
`| - Django project
--DjangoApp1
--DjangoApp2
--DjangoSettingsDir
--static
    --bower_component/
        --all Javascript Library/
    --node_build
        --all node files or npm files(if required)
    --templates
        --all custom HTML files
    --JavaScript
        --all custom JavaScript files
    --Style
        --all custom CSS files goes here
--templates //base Django templates
     --index.html`
     --index.js
     --index.css
0

Source: https://habr.com/ru/post/1598496/


All Articles