Is it possible to combine a django app and a javascript app into one app?

Viewed 169

I'm looking for ideas on how to implement the following requirement. I have 2 different applications one being a python Django app and the other one being a pure javascript app. I can get both the apps running on different ports but I need to be able to integrate the js app into the Django app. I.e. I want to add the js app into the Django app such that when you navigate to djangoapp.com/admin/js_app you go to the landing page of the js_app application. the 2 apps are https://github.com/CodeForAfrica/gmmp and https://github.com/OpenUpSA/wazimap-ng-ui

any ideas will be appreciated

3 Answers

There are 2 ways as far as I know:

  1. Add the js to each template of Django under tag. The core app is mainly served by Django
  2. Use Django to serve the API only. The js app will call the API URL endpoints to get data. The core app is mainly served by js. This approach is mainly used by static sites like blogs, simple company sites, etc

I think you can only use a port as the entry point of your app.

yes definitely you can do you just add your javascript app in static folder of django and

Related