Skip to content

Instantly share code, notes, and snippets.

@bolinocroustibat
Last active February 7, 2019 21:05
Show Gist options
  • Save bolinocroustibat/2da9805d8146c6501cec7beb8b1d0494 to your computer and use it in GitHub Desktop.
Save bolinocroustibat/2da9805d8146c6501cec7beb8b1d0494 to your computer and use it in GitHub Desktop.
Apache + Python venv + Django: module not found
module 'django_project' not found
=> Logiquement et après seulement un an de recherche il faut ajouter le dir au python path.
Normalement il suffit de faire un export PYTHONPATH="${PYTHONPATH}:/var/www/django_project"
mais ca marche que en shell, pas en apache/venv
DONC => Créer un "nano /var/www/venv/spie/lib/python3.5/site-packages/django_project.pth" (fichier .pth)
Dans lequel on met le ou les paths "/var/www/django_project" ici
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment