2009/9/1 [email protected] <[email protected]>:
>
> thanks,
>
> my project is located in /usr/local/django/myproject
> and l  had everything under /usr/local/django/ as readable end
> executable for all users, seems still no luck...

But where exactly is:

  myapp

Is it located at:

  /usr/local/django/myproject/myapp

One possibility is that you are getting hit with an import ordering
issue. I can't remember the details but have seen mention of it on
Django lists.

That or the issue I am thinking of relates to app not being listed in
INSTALLED_APPS, or issue is to do with auto discovery of apps.

Suggest you ask on Django user list on Google groups.

Graham

> On Mon, Aug 31, 2009 at 4:15 PM, Graham
> Dumpleton<[email protected]> wrote:
>>
>> 2009/9/1 [email protected] <[email protected]>:
>>>
>>> thanks, but i have in django.wsgi
>>> ---------------------------------------------
>>> import os, sys
>>> sys.path.append('/usr/local/django')
>>> sys.path.append('/usr/local/django/myproject')
>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>>>
>>> import django.core.handlers.wsgi
>>>
>>> application = django.core.handlers.wsgi.WSGIHandler()
>>> -----------------------------------------------
>>> -
>>> so PYTHONPATH should be included?
>>
>> If you are talking about the value of your PYTHONPATH environment
>> variable in your user account, then no it isn't. Apache runs as
>> distinct user and doesn't pick up your personal environment.
>>
>> If what you mean is that your app is located under:
>>
>>  /usr/local/django/myproject
>>
>> then be aware that if the user that Apache runs as doesn't have read
>> access to that directory or the apps under it, it will not be able to
>> load them. So revise your directory/file permissions.
>>
>> If you think that is okay, then explicitly state where the app is
>> located in the file system and what the directory/file permissions
>> are.
>>
>> Graham
>>
>>> On Mon, Aug 31, 2009 at 3:28 PM, Graham
>>> Dumpleton<[email protected]> wrote:
>>>>
>>>> 2009/9/1 [email protected] <[email protected]>:
>>>>>
>>>>> not sure if this is related with mod_wsgi i got an error
>>>>>
>>>>> Exception Type:         ImportError
>>>>> Exception Value:        No module named myapp.views.hometest
>>>>
>>>> That is your problem. You perhaps don't have the directory your Django
>>>> apps are in in sys.path.
>>>>
>>>> Graham
>>>>
>>>>> On Mon, Aug 31, 2009 at 1:39 PM,
>>>>> [email protected]<[email protected]> wrote:
>>>>>> I got it figured. I had misspelled project name. It works now.
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Mon, Aug 31, 2009 at 9:28 AM,
>>>>>> [email protected]<[email protected]> wrote:
>>>>>>> I am using 2.5 , installed from source.
>>>>>>>
>>>>>>> Here is the error info:
>>>>>>>
>>>>>>> [Mon Aug 31 16:23:27 2009] [error] [client 159.188.188.85] Target WSGI
>>>>>>> script not found or unable to stat: /usr/local/django/mydomain
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Aug 30, 2009 at 10:36 PM, Graham
>>>>>>> Dumpleton<[email protected]> wrote:
>>>>>>>>
>>>>>>>> 2009/8/31 weiwei <[email protected]>:
>>>>>>>>>
>>>>>>>>> here is my settings:
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> <VirtualHost *:80>
>>>>>>>>>        ServerName   mydomain.com:80
>>>>>>>>>        ServerAlias  www.mydomain.com *.mydomain.com
>>>>>>>>>        UseCanonicalName Off
>>>>>>>>>        ServerAdmin  "[email protected]"
>>>>>>>>>        DocumentRoot /var/www/hosts/mydomain.com/httpdocs
>>>>>>>>>        WSGIScriptAlias / /usr/local/django/mydomain/apache/
>>>>>>>>> django.wsgi
>>>>>>>>> <Directory /usr/local/django/mydomain/apache>
>>>>>>>>>        Order deny,allow
>>>>>>>>>        Allow from all
>>>>>>>>> </Directory>
>>>>>>>>> </VirtualHost>
>>>>>>>>> ----------------------------------------------------------------------------------
>>>>>>>>> and wsgi script:
>>>>>>>>>
>>>>>>>>> -------------------------------------------------------------------------
>>>>>>>>> import os, sys
>>>>>>>>> sys.path.append('/usr/local/django')
>>>>>>>>> sys.path.append('/usr/local/django/mydomain')
>>>>>>>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'mydomain.settings'
>>>>>>>>>
>>>>>>>>> import django.core.handlers.wsgi
>>>>>>>>>
>>>>>>>>> application = django.core.handlers.wsgi.WSGIHandler()
>>>>>>>>> ----------------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> I am on fedora11.
>>>>>>>>>
>>>>>>>>> Thanks for any help.
>>>>>>>>
>>>>>>>> First guess would be that you are using an old version of mod_wsgi.
>>>>>>>> The latest is 2.5, what are you using?
>>>>>>>>
>>>>>>>> There was a configuration corruption issue that might cause this
>>>>>>>> specific problem. It was fixed in 2.3 or 2.4.
>>>>>>>>
>>>>>>>> So, indicate what version of mod_wsgi you are using and I want to see
>>>>>>>> the full error messages from the Apache error logs around when that
>>>>>>>> occurred.
>>>>>>>>
>>>>>>>> Graham
>>>>>>>>
>>>>>>>> >>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> >
>>>>>
>>>>
>>>> >
>>>>
>>>
>>> >
>>>
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to