On 5/7/2009 5:00 PM, Graham Dumpleton wrote:
> 
> 
> On May 7, 2:41 am, George Song <[email protected]> wrote:
>> On 5/6/2009 4:02 AM, Graham Dumpleton wrote:
>>
>>
>>
>>
>>
>>> On May 6, 4:38 am, George Song <[email protected]> wrote:
>>>> On 5/5/2009 6:48 AM, Michel Thadeu Sabchuk wrote:
>>>>> Hi guys,
>>>>> I'm having a weird problem with TIME_ZONE settings. Some view list
>>>>> objects based on the time, future time objects are not shown.
>>>>> The problem is that sometimes all objects that need to be shown appear
>>>>> normally, sometimes the latest objects are not shown.
>>>>> Digging on the problem I found that sometimes my os.environ['TZ'] are
>>>>> set to 'America/Sao_Paulo' (the correct one) and sometimes it is the
>>>>> default 'America/Chicago'. I can't see any reason to this problem.
>>>>> I using python2.5 with django1.1-beta installed on a vps with ubuntu
>>>>> hardy. My django settings module have the following line:
>>>>> TIME_ZONE = 'America/Sao_Paulo'
>>>>> And my apache virtual host configuration has the following:
>>>>> <Location />
>>>>>     SetHandler python-program
>>>>>     PythonPath "['/path-to-my-project/'] + sys.path"
>>>>>     PythonHandler django.core.handlers.modpython
>>>>>     SetEnv DJANGO_SETTINGS_MODULE portal.settings
>>>>>     PythonDebug Off
>>>>> </Location>
>>>>> Does someone facing the same problem? Does anyone has a suggestion?
>>>> That is very odd indeed. Are there other Django instances within the
>>>> same virtual host?
>>> It doesn't strictly have to be other Django instances, it can be PHP
>>> or mod_perl as well. Basically anything that runs embedded in Apache
>>> processes and which expects a different timezone setting.
>>> For case where only running Python applications, formod_wsgithis
>>> problem is described in:
>>>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Timezone_and_...
>>> Same thing with mod_python, but with mod_python no way around it.
>> With mod_python, can you just use multiple interpreters?
>> <http://www.modpython.org/live/mod_python-3.2.5b/doc-html/pyapi-interp...>
> 
> No you can't. Those multiple interpreters are in the same process
> exactly as described from mod_wsgi case. The problem is because
> application in each interpreter is changing a value which is shared
> across all interpreters. This value being sorted at C library level
> outside of context of specific Python sub interpreter.

Gotcha, that makes sense.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to