Error in django interactive shell on eclipse pydev

When I click django --> shell with django environment , give me:

 from django.core import management; import test1.settings as settings; management.setup_environ(settings) 

Error:

Traceback (last last call): File "", line 1, in AttributeError: object 'module' does not have attribute 'setup_environ'

  • Eclipse 4.3.1
  • Python 2.6
  • Django 1.6

Does anyone help?

+4
source share
2 answers

This is a conflict between your version of PyDev and your version of Django. Django.core.management.setup_environ () is removed in Django 1.6. This problem was fixed in PyDev on February 4, here: https://github.com/fabioz/Pydev/commit/f546ac4

If you upgrade your installed version of PyDev to the latest (currently 3.4.1), this should start working for you.

0
source

I get this on Django version 1.10.4 in Eclipse Neon with PyDev 4.1. The reason is because the script in Preferences -> PyDev -> Interactive Console -> Initial Commands estimates the version of Django 1.10 to be less than 1.5 and executes commands for an invalid version of Django. A workaround is to remove all Django interpreter commands for the wrong version and only execute the commands for version 1.7 and higher.

0
source

All Articles