MongoDB Django and PyMongo relations

Hi everyone, sorry if the title does not match what I will ask.

I use MongoDB with Django and I connect them by using PyMongo. The question is, is it a good way to connect MongoDB and Django with the connection string? Would it effect the performance in a bad way if the project becomes a real world project? Also, I commented out the DATABASES = {} part in settings.py. and it works fine still. Is there anything I am doing wrong or I should change anything for the best of the project?

Thanks in advance.

It all depends upon what you’re going to do with your system. Without getting into the specifics of your objectives and requirements, we really can’t advise you here.

In the general case, PyMongo would be an addition to, and not a replacement for, the Django ORM. (And while what you’re saying here is valid, and I can envision a use-case for it, I would wonder why you would even be using Django in this situation.)

Hello KenWhitesell,

Thanks for your reply. What I will achieve is creating a website that does recording and uses MongoDB. The answer for the question why I am using Django is that it is not me who decides which one to use but I would like to know your suggestions as well.

I would like to get more information about PyMongo being an addition. Because I think you might mean that I should use models depending on ORMs. But this is not the case for me now. I just get the data from MongoDB and process it and then show it on the website without using Django’s “models” package. Is this a correct way in your opinion?

If it works for you, and satisfies all your requirements, great. There’s no “right” or “wrong” here. I’ve certainly used Django in a number of situations where it’s not particularly needed, just to take advantage of one or two specific features.

Alright. Thank you very much Ken!