1

Its's nice to see mongodb is connected with django but doesn't support completely. I explain why so because when you install any third party packages to your project it could written for Django models not Djongo which will fall you in Database error while migrating you apps.

djongo.database.DatabaseError

Do we have any solution for this case?

  • 1
    While Djongo is a fair attempt to make Django compatible with a MongoDB database, Django itself was not really designed with that in mind, and most of the logic therefore has difficulity to work with a non-relational database. – Willem Van Onsem May 06 '22 at 14:23
  • 1
    @kriteshvani sir willem van onsem is right at this point, django is best for relation databases not mainly designed for non-relational such as MongoDB, Redis etc. Postresql or Mysql will be best choice. – Sunderam Dubey May 06 '22 at 14:26

1 Answers1

1

Well, in the general case, the solutions you have are, in increasing order of difficulty:

  1. Get rid of Djongo. Use Django with an SQL database, as that's what it's designed for. You can still use MongoDB for whatever data you might have in there, but the main Django database is better off being SQL.
  2. Don't use packages that don't work with Djongo.
  3. Fix the packages that don't work with Djongo to work with it.

I would recommend going for (1)...

AKX
  • 152,115
  • 15
  • 115
  • 172
  • Why do people are investing time to build djongo, if Django is suitable only for SQL? – kritesh vani May 09 '22 at 09:43
  • Why do people do things in general? Django is designed for SQL; Djongo is a translator "hack" on top of it, which works for many people and many cases, but not in all of them. – AKX May 09 '22 at 10:39