AttributeError: 'module' object has no attribute 'setup'; django setup working in one project but not other

天涯浪子 提交于 2019-12-08 17:48:27

You need to upgrade your version of Django to a supported version. Newer versions of Django have the setup function. See the list of supported Django versions

The answer was in the comments:

The error suggests that you're running Django 1.6 or older, in which case you don't need to call setup(). – knbk Mar 23 '16 at 16:14

The django.apps module was added in Django 1.7. You'll need to upgrade Django or change the script to work with your version of Django. Upgrading is recommended, because 1.7 and older are now end of life, and do not receive security fixes. – Alasdair Mar 23 '16 at 16:23

Both django.setup() and django.apps were added in 1.7.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!