Re: django sessions

2019-07-07 Thread Chetan Ganji
Hii, below answer might ring some bells. https://stackoverflow.com/questions/2551933/django-accessing-session-variables-from-within-a-template Cheers! On Sat, Jul 6, 2019, 5:24 PM Luka Lelashvili wrote: > Hello, how can I access session in my base.html? {% request.session.name > %} doesn't

django sessions

2019-07-06 Thread Luka Lelashvili
Hello, how can I access session in my base.html? {% request.session.name %} doesn't work on base.html any clues? -- 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

Django sessions not configuration issues for Heroku/Redis

2018-10-10 Thread jesse
Hello, I'm having issues with Django sessions on Heroku/Redis. I expect to be able to login and stay logged in. Instead, user will continually be logged out and sessions do not persist. I posted more details on Stack Overflow here: https://stackoverflow.com/questions/52535488/django-sessions

Django sessions configuration issues in production with Heroku/Redis

2018-10-10 Thread jesse
Hello, I'm having trouble configuring Django sessions to be persistent. I expect a user to be able to log in on first try and then stay logged in. Currently, it takes multiple tries to login and then the user is logged out. Sessions are clearly not persisting. I posted a bounty

Re: How to delete least recently used not expired django sessions?

2018-08-23 Thread Web Architect
8 at 05:44:22AM -0700, Web Architect wrote: > > Hi, > > > > We are using persistent django sessions for our website where in the > > session information is stored in MySQL. Over last couple of years, the > > session data has grown to a huge number and we

Re: How to delete least recently used not expired django sessions?

2018-08-23 Thread Web Architect
Hi Avraham, Thanks for the recommendation. Will take a look at the package. Thanks. On Monday, August 20, 2018 at 1:00:03 PM UTC+5:30, Avraham Serour wrote: > > maybe something like this could be useful for your use case: > https://pypi.org/project/django-session-timeout/ > it has an option

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Aug 17, 2018 at 05:44:22AM -0700, Web Architect wrote: > Hi, > > We are using persistent django sessions for our website where in the > session information is stored in MySQL. Over last couple of years, the > session

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Avraham Serour
maybe something like this could be useful for your use case: https://pypi.org/project/django-session-timeout/ it has an option for SESSION_EXPIRE_AFTER_LAST_ACTIVITY maybe this could also be useful for you: https://django-session-security.readthedocs.io/en/latest/ On Mon, Aug 20, 2018 at 8:34

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Jason, Thanks for your response. As mentioned in my earlier post...I have a long expiry date for the sessions (and hence, the cookies) as we want our users to be always logged in or in session (till they clear their cookies). And that's what is causing the issue. The goal is to keep the

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Hemendra, Thanks for the workaround. Would look at it's feasibility in our existing scenario. Thanks. On Saturday, August 18, 2018 at 3:58:10 PM UTC+5:30, HEMENDRA SINGH HADA wrote: > > Hi, > > I can suggest one thing it might be useful for you. For this you need to > create one more

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Mike Dewhirst
> We are using persistent django sessions for our website where in the > session information is stored in MySQL. Over last couple of years, the > session data has grown to a huge number and we were planning to clean > it up. > I know that there is a djan

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Jason
With database sessions out of the box, no. https://github.com/django/django/blob/master/django/contrib/sessions/base_session.py You can see there are three attributes for a session model: key, data and expire_date That said, since sessions are backed by browser cookies, django's default is

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread HEMENDRA SINGH HADA
Hi, I can suggest one thing it might be useful for you. For this you need to create one more attribute in session table like *last activity,* which will update every time when user is logged in and perform some action. Write one middle-ware which will check the activity of each user and update

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Web Architect
months. We can force out the users who aren't active since last 3 months. Is there a way to do that in django? Thanks. On Saturday, August 18, 2018 at 5:11:23 AM UTC+5:30, Mike Dewhirst wrote: > > On 17/08/2018 10:44 PM, Web Architect wrote: > > Hi, > > > > We are using pe

Re: How to delete least recently used not expired django sessions?

2018-08-17 Thread Mike Dewhirst
On 17/08/2018 10:44 PM, Web Architect wrote: Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know

How to delete least recently used not expired django sessions?

2018-08-17 Thread Web Architect
Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know that there is a django management command 'clearsessions' and we

Using Django Sessions

2018-03-23 Thread Derek Zeng
You can have a flag in cart class to mark if things are cleared. Then in the __iter__ function, check the flag before getting the keys. If you do this you also need to add the check in add/remove and others accordingly. -- You received this message because you are subscribed to the Google

Using Django Sessions

2018-03-22 Thread Manu Febie
Hello, I am practicing for my college exams. I am building a Restaurant Order System with Django and I am using Django sessions for the first. I borrowed some ideas from the "Django by example". Below you can find the MenuItem model and Order Model. class MenuItem(models.Model):

Handle django sessions when doing file-operations

2013-12-04 Thread sachin
uot; within the root of the project directory. I need to handle this using django-sessions. I need some pointer/examples so that I can solve this issue. More about this app: https://github.com/psachin/haqiba -- You received this message because you are subscribed to the Google Groups "Django users&qu

How to store an object in django sessions framework

2013-08-16 Thread shiva krishna
I have an django and i am trying to store an object in django session varaible, and trying to access that in the redirected view, but its showing `keyerror` as below def payment(request): if request.method == 'POST': form = CardForm(request.POST) if

Re: Django Sessions - HttpResponseRedirect

2012-07-01 Thread M Oklah
I saw that post and set request.session.modified = True before redirecting in the view with no luck! Any other ideas? Thanks, -Moe On Sun, Jul 1, 2012 at 4:08 PM, Alagappan wrote: > I think someone has faced a similar issue as yours. Find more details at: > >

Django Sessions - HttpResponseRedirect

2012-07-01 Thread M Oklah
Hello, Why is it that the session id changes after a redirect is initiated from a view function? This is basically the scenario, after the browser makes a POST request to a custom login() view function, the view function authenticates the user and redirects (302) the user back to a page, but the

Re: Hooking into Django Sessions

2012-05-08 Thread Tom Evans
On Mon, May 7, 2012 at 7:48 AM, M Oklah wrote: > > Hello, > > Is it possible to hook into Django so that a user defined callback method is > executed each time a session expires? > > > Thanks, > > -Moe > Yes/no/maybe. Depends what you want to do. First of all, nothing

Hooking into Django Sessions

2012-05-07 Thread M Oklah
Hello, Is it possible to hook into Django so that a user defined callback method is executed each time a session expires? Thanks, -Moe -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django sessions issue

2010-06-07 Thread aa56280
> You better show some code now... My urls.py has the following entry: (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page' : '/'}) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django sessions issue

2010-06-04 Thread Tom Evans
On Fri, Jun 4, 2010 at 8:45 PM, aa56280 wrote: >> How are you logging out? Are you sure you are calling >> django.contrib.auth.logout() ? > > Yup, I'm calling django.contrib.auth.views.logout() > You better show some code now... Cheers Tom -- You received this message

Re: Django sessions issue

2010-06-04 Thread aa56280
> How are you logging out? Are you sure you are calling > django.contrib.auth.logout() ? Yup, I'm calling django.contrib.auth.views.logout() -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django sessions issue

2010-06-04 Thread Tom Evans
On Thu, Jun 3, 2010 at 9:06 PM, aa56280 wrote: > Django's docs say: "When a user logs in, Django adds a row to the > django_session database table. Django updates this row each time the > session data changes. If the user logs out manually, Django deletes > the row. But if the

Django sessions issue

2010-06-03 Thread aa56280
Django's docs say: "When a user logs in, Django adds a row to the django_session database table. Django updates this row each time the session data changes. If the user logs out manually, Django deletes the row. But if the user does not log out, the row never gets deleted." I'm logging out of my

Re: Django Sessions / Multidimensional List

2009-07-02 Thread Rama Vadakattu
please have a look at this section http://docs.djangoproject.com/en/dev/topics/http/sessions/#when-sessions-are-saved --rama On Jul 2, 2:15 am, bjoern_mainz wrote: > Hi, > > what i try do do is (in plain python): > > products = [] > products.append({"product" :

Django Sessions / Multidimensional List

2009-07-01 Thread bjoern_mainz
Hi, what i try do do is (in plain python): products = [] products.append({"product" : "foo","quantity": 5}) products.append({"product": "foz","quantity": 1}) ---Django--- def add_to_basket(request): if not 'products' in request.session: