Re: django development server timeout too quick

1,650 views
Skip to first unread message

Siddharth Ghumre

unread,
Apr 25, 2013, 4:13:08 AM4/25/13
to django...@googlegroups.com
Hi Hadi,

I am using sessions.middleware.SessionIdleTimeout in my app which takes care of the session management

https://pypi.python.org/pypi/django-session-idle-timeout/1.0.1

Its clean and easy way to handle session timeouts.

-Siddharth



On Wed, Apr 24, 2013 at 11:57 AM, Hadi Sunyoto <hadis...@gmail.com> wrote:
The problem is like this:

i am using django admin, and in several forms, it might take around 10-20 minutes to fill up.
By the time save button is pressed, i am always redirected to login page.

The question is: how can i make the timeout longer (or maybe last forever)

I set the cache to file and session_engine to db

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': 'some/path',
        'TIMEOUT': 100000,
    }
}
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"

What else am i missing here? any direction will be much appreciated

i also have tried to set --noreload in runserver so that file changed does not get reloaded, but i still get the same problem.

i don't plan on using apache/ngix/etc because this is only for my personal use

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris Lawlor

unread,
Apr 26, 2013, 9:15:41 AM4/26/13
to django...@googlegroups.com
Hadi,

What is your SESSION_COOKIE_AGE set to? This setting controls session expiry. The default is 2 weeks. If you are not setting SESSION_COOKIE_AGE, check that your code is not calling request.session.set_expiry() anywhere.

For light use, the default session backend (db) should meet your needs. Have a look at the warning here: https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions (Note link to dev version of docs). Using the cached_db session engine with a file based cache isn't buying you anything but extra complexity.
Reply all
Reply to author
Forward
0 new messages