pythondjangodjango-nonreldjango-mongodb-engine

raise ImproperlyConfigured, exc_info[1], exc_info[2]


I created a django (1.6.1) project and using mongodb with it. when I ran the python manage.py runserver 0.0.0.0:8000 to start server it gives me the following error

  File "D:\Python34\lib\importlib\__init__.py", line 129, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2186, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2169, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2158, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1209, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1133, in _exec
  File "<frozen importlib._bootstrap>", line 1432, in exec_module
  File "<frozen importlib._bootstrap>", line 1537, in get_code
  File "<frozen importlib._bootstrap>", line 1497, in source_to_code
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "D:\Python34\lib\site-packages\django_mongodb_engine\base.py", line 234
    raise ImproperlyConfigured, exc_info[1], exc_info[2]
                              ^
SyntaxError: invalid syntax

What does this error mean?


Solution

  • django-mongodb-engine does not support Python 3.x.

    Categories

    ...

    Programming Language :: Python :: 2.5
    Programming Language :: Python :: 2.6
    Programming Language :: Python :: 2.7
    

    Meaning of the error:

    Syntax for the raise statement changed in Python 3.x. raise expression, expression, expression syntax is not valid in Python 3.x.

    >>> raise ValueError, 'msg'
      File "<stdin>", line 1
        raise ValueError, 'msg'
                        ^
    SyntaxError: invalid syntax
    
    >>> raise ValueError('msg')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: msg