How to Setup DjangoRestFrameWork with Mongo DB

35 views
Skip to first unread message

venna venkatReddy

unread,
Mar 28, 2020, 4:09:42 AM3/28/20
to Django users
hey guys,

i am new to Django and Any one can guide me how to setup DjangoRestFrameWork with Mongo DB,

My task is:

i need to create Api for data inserting and updating and delecting that data must in mongodb, I previous work with sqlite3 and postgresql and mysql but this is the first time to work with mongodb


Please help, thanks

Anh Nguyen

unread,
Mar 28, 2020, 4:21:58 AM3/28/20
to django...@googlegroups.com
You can use Djongo or Django rest framework mongoengine.
But I highly recommend DON’T.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/03e4676f-8175-48a7-872c-e7e2223a8167%40googlegroups.com.

VenkataSivaRamiReddy

unread,
Mar 28, 2020, 4:29:35 AM3/28/20
to django...@googlegroups.com
i tried but not getting

Andrew C.

unread,
Mar 28, 2020, 12:24:04 PM3/28/20
to django...@googlegroups.com
I highly recommend not using MongoDB. Sure, they can plaster a banner saying “Google supports us” but many industry leaders have tried and failed using it. It can’t store data that easily once you grow, making it unlikely for usage in the future for employment by any startup or corporation and for any realistic goal of scaling, too.

Use PostgreSQL’s NoSQL style with JSONB (JSONField) if you have to, and, if you really need to index it, use a GIN index. Postgres is battle tested, whereas Mongo is battle defeated.

I’d suggest you get to understand SQL vs. NoSQL first. Understand what’s actually needed as an attribute and what isn’t. Most of the time, what you think is non relational becomes relational. You can think partitioning and sharding.

Sometimes you have to use NoSQL like with user profiles in which some fields aren’t required. Use a JSONField, because I bet the REST of your data is still relational.

Follow the general rules of why this works out. Not that people don’t use a full NoSQL db like cassandra, but they use it for different use cases (like throttling).

On Sat, Mar 28, 2020 at 4:28 AM VenkataSivaRamiReddy <vennave...@gmail.com> wrote:
i tried but not getting

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages