3

I am learning Django through the dj4e course. In my project I have set up django-extensions for a previous section of the course. When I moved to a new section and created a new app with the code

python manage.py startapp autos

I get the error

"ModuleNotFoundError: No module named 'django-extensions'"

I have resolved this by commenting out 'django-extensions' in the settings.py file.

However can anyone talk me through why this happened, I'm trying to get a better understanding of the processes.

edit I am working in a virtual environment and django-extensions is installed in that environment.

1 Answers1

1

You can check whether django-extensions is installed in your virtual environment by entering below code in your shell

import django_extensions
django_extensions.VERSION

if you are getting ModuleNotFoundError then install django-extensions using pip install django-extensions

After successfull installation add django_extensions to your settings.py file as below.

INSTALLED_APPS = (
    ...
    'django_extensions',
)
Aswin A
  • 74
  • 3
  • 2
    I already have it installed in my virtual environment and was working in that environment. And it is in my settings.py. only way I could make it work was commenting it out – Martin Slater Apr 15 '21 at 10:12