2👍
✅
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.
Source:stackexchange.com