0

While trying to deploy my django project on my Gandy hosting server, while starting running uwsgi, the uwsgi.log shows an error

ModuleNotFoundError: No module named 'django'

while executing the following line from my wsgi.py file

from django.core.wsgi import get_wsgi_application

here is the full wsgi file:

import sys
import os
import os.path

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                'projectname')))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projectname.settings')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

from what I understand, django is not installed in my virtual environment, but it is listed in my requirements.txt file

Django==3.0.6
django-background-tasks==1.2.5
django-compat==1.0.15
django-extensions==3.0.3
django-mathfilters==1.0.0

Can anyone pin point where I am missing something?

Tibibs
  • 71
  • 5
  • Does this answer your question: [How to use requirements.txt to install all dependencies in a python project](https://stackoverflow.com/questions/41457612/how-to-use-requirements-txt-to-install-all-dependencies-in-a-python-project) – Jaydeep Aug 05 '20 at 17:48
  • I have actually restarted a new virtual environment on my local machine, and made sure everything runs fine with runserver. I have generated a new requirements file asgiref==3.2.10 Django==3.1 pkg-resources==0.0.0 pytz==2020.1 sqlparse==0.3.1 but still the same problem, django can't be found on the remote server – Tibibs Aug 05 '20 at 18:09

0 Answers0