开发者

django session timesout within 10 seconds

I've finally deployed the app. on production and the session timesout very quickly.

If I'm not continuously clicking on links, it'll expire in 15-20 seconds.

This doesn't happen in Dev. but again the setup is comp开发者_如何转开发letely different.

Here is the setup I have in production - nginx + apache (wsgi) + django 1.1.2

Backend is mysql.

The keepalive in nginx is "keepalive_timeout 15;" but the documentation says its for the process nginx launches and isn't related.

Following is present in the settings.py -

`TEMPLATE_CONTEXT_PROCESSORS = (`  
    `'django.core.context_processors.auth',`   
    `'django.core.context_processors.debug',`   
    `'django.core.context_processors.i18n',`   
    `'django.core.context_processors.media',`   
    `'django.core.context_processors.request',`   
    `'myown.custom_settings_context_processor.myown_custom_settings',`   
    `)`   

`SESSION_ENGINE = (`   
        `'django.contrib.sessions.backends.cache'`   
`)`   

`INSTALLED_APPS = (`   
    `'django.contrib.auth',`   
    `'django.contrib.contenttypes',`   
    `'django.contrib.sessions',`   
    `'django.contrib.sites',`   
    `'django.contrib.admin',`   
`)`

If any more info. is required, please let me know and I'll put it. Any pointers about why this would be happening, appreciated.


Thanks to Anil from the django team.
Seems I haven't configured by caching properly.
Went to the default caching by commenting these lines in my settings.py and everything worked like a charm !!!!

SESSION_ENGINE = (
'django.contrib.sessions.backends.cache'
)

Thanks Anil & BrianHV

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜