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..

2
  • Please try to use NGinx. Commented Mar 29, 2016 at 5:48
  • To prevent mix up of Angularjs with Django: stackoverflow.com/a/27282607/2412381 Commented Aug 11, 2016 at 17:46

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.