I am new to the world of restful programming and have a Django website. My goal is to dynamically load a part of the website.
Currently, my workflow is as follows:
When I call a URL (such as localhost:8080/index
), it routes to the Django view, which retrieves data from the database (specifically MongoDB). The view then fetches the template, renders everything together, and sends it back to the browser.
What I aim to enhance is:
With an already opened URL like localhost:8080/index
, when I trigger an event (e.g., click on a link), I want to send a request to the database to load additional data.
My inquiry is:
What steps should I take to securely connect JavaScript/ajax with my MongoDB?
Furthermore, I am contemplating utilizing a front-end MVC framework (considering Backbone due to my limited knowledge) to handle front-end requests. For instance, localhost:8080/index#2
would return objects with an id : 2
from my database.