[Fixed]-How do I display data from MongoDB in an HTML page?

1👍

From my understanding of the question, current state is:

  • You have imported data to MongoDB
  • You want to retrieve some data into HTML

I didn’t understand where you are stuck and hence simple steps would be to create your models.py file defining the fields that you mentioned, email_id, employee_id, etc. Check details on how

Django models API lets you create, retrieve, update and delete objects. Next topic in this documentation page.

I recommend reading through Django documentation thoroughly and trying out things in a demo app from here – Django Models and Databases

Extra: You could use raw SQL queries if you used SQL based DB. But Django quotes:

You should be very careful whenever you write raw SQL. Every time you use it, you should properly escape any parameters that the user can control by using params in order to protect against SQL injection attacks. Please read more about SQL injection protection.

Leave a comment