unable Integrating Djongo 1.3.1 with django 2.2.10

1,989 views
Skip to first unread message

Eswar Subramanyam

unread,
Mar 19, 2020, 4:35:52 PM3/19/20
to Django users
Hi 

I opted for Djongo to take advantage of Django ORM with MongoDB..

but while starting the server, i get the following error

AppData\Roaming\Python\Python38\site-packages\django\db\utils.py", line 121, in load_backend
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'


I have lost a lot of time trying to figure out, and came to a conclusion that i cant use ORM on Mongo DB.

Have someone got a clue on what going wrong ?

I dump also all the installed packages

Thanks for your help/

Package               Version
--------------------- ----------
asgiref               3.2.5
bson                  0.5.8
certifi               2019.11.28
chardet               3.0.4
dataclasses           0.6
Django                2.2.11
django-menu-generator 1.0.4
djongo                1.3.1
idna                  2.9
mongoengine           0.19.1
pip                   20.0.2
pymango               0.1.1
pymongo               3.10.1
python-dateutil       2.8.1
pytz                  2019.3
requests              2.23.0
setuptools            41.2.0
six                   1.14.0
sqlparse              0.2.4
urllib3               1.25.8

Khaleel Ahmed H. M. Shariff

unread,
Mar 19, 2020, 10:51:14 PM3/19/20
to django...@googlegroups.com
Hi Eswar,
May Peace, Blessings & Mercy of Almighty God be on you!

Short answer, your environment is messed up. Now, let us address who or how was it messed up

There are many reasons why you could be getting this error. 
One major issue similar I have frequently faced is in case you have multiple versions of Python on the same box. Python 2.x & 3.x installed on the same box. Django version 1.x is compatible with Python 2.x.  Python 3.x & django 1.x do not work together. In case you have multiple versions of Python installed, you may have to tweak the PATH to indicate the appropriate directory in the search path ahead of the other directories. 

This is probably your reason for the stuff not working as you have both 2.2.11 & 1.3.1 of Django installed.   

1. You may be using an IDE like pycharm/spyder/any other IDE. Normally, these IDEs try to download packages. In case there is a version mismatch in the source of the package, there could be a mess up.
2. Your PATH & PYTHONPATH environment variable may not have the relevant directory or have a different directory with the same file name ahead of the actual file you want loaded.
3. You may be using a virtualenv. Try to deactivate & try executing the same
  
Hope this helps. 
Kindly share your experience.
Thanks in advance. 


God Bless You!
God Bless India!!

--

Love & Regards
Dr. (h.c.) Khaleel Ahmed H. M.

Managing Director, Tanzanite Realty India Private Limited

+91-9845007864

+91-7829777864

-----------------------------------------------------------------------
Human Life is Precious
Koran Surah Ma'idah Chapter 5 Verse 32:
If anyone killed a person, not in retaliation of murder, or (and) to spread mischief in the land - it would be as if he killed all mankind, & if anyone saved a life, it would be as if he saved the life of all mankind.



--
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/6b10fe72-f834-4eb2-86e9-0595031e4b4a%40googlegroups.com.

Eswar Subramanyam

unread,
Mar 20, 2020, 5:03:32 AM3/20/20
to django...@googlegroups.com
Hi Khaleel

God bless you and your family too. 

I understand your point, but i have only one python 3.8 installed. And Django version is 2.2.1. other package 1.3.1 isnt Django but Djongo, so i am not able to figure out where this is issue is cropping up. i cleaned also the pyharm packages but still doesnt work.

Thank you for your help.

Kind Regards
Es.



--
Cordialement,
Eswar Subramanyam.

Eswar Subramanyam

unread,
Mar 20, 2020, 5:33:44 AM3/20/20
to Django users
Hi Khaleel and whoever this may help in the future,


Actually you were right Khaleel, on those lines i checked this thread which was useful to me.

Following which i was stareing at the exception and realised that the clue which was in front of me since hours to resolve this issue.Like in Java, python gives you the root cause of an exception, but as i was used to Java and .Net i didnt realise the annotation used by python.

The exception i was bothered about the exception:
AppData\Roaming\Python\Python38\site-packages\django\db\utils.py", line 121, in load_backend
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'

Where as python had already listed the root cause which was :

\Python\Python38\site-packages\djongo\database.py", line 2, in <module>
    from pymongo import MongoClient
ModuleNotFoundError: No module named 'pymongo'

The above exception was the direct cause of the following exception:

Indeed that's where Khaleel you were right, PyMongo i installed through pycharm, which desginated a sitepackage folder that wasnt my user site-package...

Hope this helps someone falling into the same trap.

Cheers,
Es.

Khaleel Ahmed H. M. Shariff

unread,
Mar 20, 2020, 7:23:22 AM3/20/20
to django...@googlegroups.com
HI Eswar,
May Peace, Blessings & Mercy of Almighty God be on you!

I should I realized it earlier. It would have saved your time.

In Python, we read the last line in the list of errors & do not really care for the earlier errors.

Thanks you very much for the update. 

God Bless You!
God Bless India!!

--

Love & Regards
Dr. (h.c.) Khaleel Ahmed H. M.

Managing Director, Tanzanite Realty India Private Limited

+91-9845007864

+91-7829777864

-----------------------------------------------------------------------
Human Life is Precious
Koran Surah Ma'idah Chapter 5 Verse 32:
If anyone killed a person, not in retaliation of murder, or (and) to spread mischief in the land - it would be as if he killed all mankind, & if anyone saved a life, it would be as if he saved the life of all mankind.

--
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.

Sam Chaffy

unread,
Mar 20, 2020, 11:51:25 PM3/20/20
to Django users
Install pymongo package by > pip install pymongo


or, better practice

make a virtual environment directory where all your dependencies will be installed.


> python -m venv  myvenv (assuming you name it myvenv)

If you are in Windows 

activate virtual environment with:

> cd in directory where you created virtual environment

> myvenv\Scripts\activate

Make sure you have pip installed

> pip install pymongo

then you won't have this error. 

VenkataSivaRamiReddy

unread,
Mar 28, 2020, 3:58:55 AM3/28/20
to django...@googlegroups.com
hi bro, I need help regrading Django rest framework with Monogod, please reply ASAP

On Fri, Mar 20, 2020 at 2:05 AM Eswar Subramanyam <eswar.su...@gmail.com> wrote:
--
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