Django: ImportError No module named myapp.views.hometest

I have fecora 11, install django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runningerver" on the local computer. It is working fine. I got an error when I test from a remote browser.

Thanks for any suggestion and help!

+3
source share
4 answers

I had this problem. He left when I added sys.path.append('/path/to/project')to my .wsgi file.

+4
source

, Django, $PYTHONPATH ( Python )? , Django /home/wwwuser/web/myproj, /home/wwwuser/web $PYTHONPATH. script, -.

+2

, , PYTHONPATH, urls.py myproject.myapp.views.functionname.

:

  • , PYTHONPATH . .
  • django ( , urls.py), ?
+1
  • env django.wsgi. env, django.wsgi, env ./manage runserver , .
  • In addition, if there is another myapp package that can be found through PYTHONPATH before /usr/local/django/myapp, it ImportErrorcan be raised.
+1
source

Source: https://habr.com/ru/post/1716526/


All Articles