|
Posted by ramesh03 |
|
|
Hi,
When i run on python manage.py runserver its working fine,but when I run on apache server its giving errors like, ImportError at /mainPage No module named mySite.modelsRequest Method: GET Request URL: http://127.0.0.1/mainPage Django Version: 1.3.1 Exception Type: ImportError Exception Value: No module named mySite.models Exception Location: //vschnws2001/share/django\myFirstSite\mySite\views.py in <module>, line 6 Python Executable: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\httpd.exe Its not importing functionality from model.py so how to avoid this errors in apache,mod_wsgi. Thanks, |
|
|
Posted by arwa |
|
|
Hi, in your project "myFirstSite" in app "mySite" try to see "views.py"
At line 6 you have something like this: "from mySite.models import *" Is possibile that your PYTHON_PATH is not correctly set. If you want you can use this view to see all paths in pythonpath: def test_paths(request): out = '<br>'.join(sys.path) return HttpResponse(out) I think that you have also all these paths in exception page in debug mode. --- Last Edited by arwa at 2012-02-21 07:07:13 --- |
|
|
Posted by ramesh03 |
|
|
Thanks, arwa.
yes, At line 6 i have something like this: "from mySite.models import *" My PYTHONPATH is D:\share\django\myFirstSite(Which is my current project location) fixed this from env variables. Its working prefectly in local runserver command. |
|
|
Posted by arwa |
|
|
Your enviroment variables now is not used by apache/wsgi (like runserver for your user).
Probably you have an wsgi file that say how apache interprets python. When it breaks your browser shows something like this: http://stackoverflow.com/questions/2125080/how-can-i-see-error-logs-of-django-views After python version you have python paths. Try to see if there is D:\share\django\myFirstSite If is not in you must to modify wsgi file for your apache. I hope that this info is userful for you to solve the problem. |
|
|
Posted by ramesh03 |
|
|
Yes, Problem with my 'wsgi' file,fixed that and now its running fine.
ThanQ. |


