On 11 November 2010 02:19, Carl Nobile <carl.nob...@gmail.com> wrote: > You don't have your paths set up correctly. In your wsgi hook file you > need to import everything you will need to bring up Django correctly. > You need to import the django dir; any local site-packages that are > not part of python; plus set the DJANGO_SETTINGS_MODULE environment > var. > > You can use: > > PATH = os.path.dirname(__file__) > > to start with. This will give you the path to your wsgi hook file. > Then from this you can find all the dirs that need to be in your path. > > not sys.path.count(PATH_TO_SET) and sys.path.insert(0, PATH_TO_SET) > > The above line will set any path you want into the Python paths. 1st > it checks that the path has not already been set then sets it if it > isn't set. Set the path to Django, your app, then any local packages > in this order. The last one set becomes the 1st in the Python path.
Don't however do this to indicate the location of a site-packages directory of a Python installation. This would be bad as it would imply that mod_wsgi is actually compiled against or using a different Python installation to where you originally installed Django. Use the procedures outlined in: http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Shared_Library http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Installation_In_Use to ascertain what Python installation your mod_wsgi is compiled against and using. Most likely you have multiple Python installations on your system and mod_wsgi wasn't updated to use newer version. Post the results of your investigations based on that documentation and we can verify for you how your system is set up and what changes you should make. Graham > Finally set: > > os.environ['DJANGO_SETTINGS_MODULE'] = 'your_app_path.settings' > > You will need to import os, sys at the top of your hook file. > > ~Carl > > On Wed, Nov 10, 2010 at 8:09 AM, Lalit Chattar <lalitjain1...@gmail.com> > wrote: >> ImportError: No module named django.core.handlers.wsgi >> >> i m new in django. i m using wsgi with python 2.7 but it gives some >> error which i mentioned above.. >> >> but this module already installed >> >> please help me............. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to modw...@googlegroups.com. >> To unsubscribe from this group, send email to >> modwsgi+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> >> > > > > -- > ------------------------------------------------------------------------------- > Carl J. Nobile (Software Engineer) > carl.nob...@gmail.com > ------------------------------------------------------------------------------- > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to modw...@googlegroups.com. > To unsubscribe from this group, send email to > modwsgi+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to modw...@googlegroups.com. To unsubscribe from this group, send email to modwsgi+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.