1

structure of my application looks like:

myapp
--backend
--env
--frontend
  -- .idea
  -- app
  -- assets
  -- bower_components
  -- views
  -- .htaccess
  -- index.html
  -- node_modules


flag

I used Django as an API and returned the JSON objects from the API and use the data in my AngularJS app in front-end.Both frontend and backend are running on different ports. In the development server, I used start the django server using the following command:

cd backend
./manage.py runserver 127.0.0.1:8000

and start the webserver using:

cd frontend
grunt serve

Now I want to move my application on production server.. So please suggest me how to do it. I have setup the production server (django with apache2 and mod_wsgi). But I dont know how to integrate angularjs with that..

shalin
  • 373
  • 3
  • 19

1 Answers1

1

I am currently running few projects in which i use django at the backend and angularjs at the front end.This is what i did.

1.All my javascript files are served from static folder.

2.Returns an html from django on initial load.

3.The html file loads scripts required including angular.js mymodule.js and mycontroller.js from static folder.

4.data required for the page is loaded by sending ajax requests inside controller.js to django server for which django returns json response.

5.The response is renderd in page using angularjs

jithin
  • 1,412
  • 2
  • 17
  • 27