Django project running on AWS lightsail, No module named "django_extension"

Keywords: Django - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)

bnsupport ID: f607620a-524e-0a8e-c5a8-53716ee111db

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues

bndiagnostic failure reason: I do not know how to perform the changes explained in the documentation

Platform: AWS lightsail - Django project
Issue : website showing 500 error, by using Bndiagnostic tool, the Apache error log shows “ModuleNotFoundError: No module named django_extsion”
BNSupport ticket: f607620a-524e-0a8e-c5a8-53716ee111db

Description: I’m quite new to AWS lightsail and bitnami. I started by following the AWS official instruction to create a tutorial project, and the project runs perfectly with no problem.
This tutorial :

I already had a complete Django project which is ready to deploy to the server. I uploaded my project files to /opt/bitnami/projects/mysite/
After I finished to set up the and bitnamt apache conf files. This error pops up.
Looks like the Apache didn’t recognize the extra python package which I already installed on the server. I’m pretty sure I installed “django_extensiono” by Pip in the server.

When I run
pip install django-extensions
I got this

Requirement already satisfied: django-extensions in ./.local/lib/python3.8/site-packages (
Requirement already satisfied: Django>=2.2 in /opt/bitnami/python/lib/python3.8/site-packa
ges (from django-extensions) (3.1.6)
Requirement already satisfied: asgiref<4,>=3.2.10 in /opt/bitnami/python/lib/python3.8/sit
e-packages (from Django>=2.2->django-extensions) (3.3.1)
Requirement already satisfied: pytz in /opt/bitnami/python/lib/python3.8/site-packages (fr
om Django>=2.2->django-extensions) (2021.1)
Requirement already satisfied: sqlparse>=0.2.2 in /opt/bitnami/python/lib/python3.8/site-p
ackages (from Django>=2.2->django-extensions) (0.4.1)```

Follow up
This is error from bndiagnostic tool

**ip_address**:3788] File "<frozen importlib._bootstrap>", line 991, in 
 [Thu Aug 19 00:46:40.764486 2021] [wsgi:error] [pid 11397] [client 
**ip_address**:3788] File "<frozen importlib._bootstrap>", line 973, in 
 [Thu Aug 19 00:46:40.764507 2021] [wsgi:error] [pid 11397] [client 
**ip_address**:3788] ModuleNotFoundError: No module named 'django_extensions'```

Hello @yifei_chen,

Thanks for using our Bitnami Django stack! This can be caused because you didn’t install the module using sudo but your project requires it. Could you check the output of the following commands:

pip show django-extensions
sudo pip show django-extensions

Francisco de Paz

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.