Re: session id attribute error

2022-09-19 Thread Mohammad Ehsan Ansari
Hi SessionStore is a model class? if yes you can use pk instant of id On Monday, 19 September 2022 at 22:48:02 UTC+5:30 aashishk...@gmail.com wrote: > Do this > > request.session.get(‘id’) > > On Mon, 19 Sep 2022 at 1:30 PM, shiva singh wrote: > >> hello everyone please help me how can solve

Re: session id attribute error

2022-09-19 Thread Aashish Kumar
Do this request.session.get(‘id’) On Mon, 19 Sep 2022 at 1:30 PM, shiva singh wrote: > hello everyone please help me how can solve this problem:-[image: > image.jpeg] > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from

Re: session id attribute error

2022-09-19 Thread Muhammad Juwaini Abdul Rahman
That was user, so probably you need request.user.id, not session. On Mon, 19 Sept 2022 at 16:00, shiva singh wrote: > hello everyone please help me how can solve this problem:-[image: > image.jpeg] > > -- > You received this message because you are subscribed to the Google Groups > "Django users

Re: session related error

2022-09-16 Thread subin
Kindly notify me should you need any other information. On Fri, Sep 16, 2022 at 3:40 PM shiva singh wrote: > Hi everyone > > anyone give solution for this problem: > AttributeError: 'SessionStore' object has no attribute 'id' > [16/Sep/2022 19:28:16] "POST /jobpostsubmit/ HTTP/1.1" 500 66025 > >

Re: Session in Python for Login and Logout

2022-06-07 Thread 'Kasper Laudrup' via Django users
On 07/06/2022 06.59, Mukul Verma wrote: yeah i was saying in Django Thanks Everyone please tell me something in steps for this like how to use session variable in django and can create session currently i am able to generate token (access and refresh) and further need to create session  with th

Re: Session in Python for Login and Logout

2022-06-07 Thread 'Kasper Laudrup' via Django users
On 07/06/2022 06.59, Mukul Verma wrote: yeah i was saying in Django Thanks Everyone please tell me something in steps for this like how to use session variable in django and can create session currently i am able to generate token (access and refresh) and further need to create session  with th

Re: Session in Python for Login and Logout

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
I think what he meant is 'session' in django. Probably can take a look at this: https://docs.djangoproject.com/en/4.0/ref/request-response/ For example, django app wants to know who is the current user, can use something like: `request.user` On Mon, 6 Jun 2022 at 22:45, 'Kasper Laudrup' via Djan

Re: Session in Python for Login and Logout

2022-06-06 Thread 'Kasper Laudrup' via Django users
On 06/06/2022 11.16, Mukul Verma wrote: Hii, Help me out in this stuff please, some steps for solve this out Python is a programming language so there's no such thing as a "session for login and logout". If you want someone to help you, you should try to clarify what you actually need hel

Re: Session backend for production

2019-11-25 Thread Parth Joshi
Cache implementation will be definitely use faster if you are using MVT. If using REST (DRF) then token Auth definitely helps. Regards, Parth Joshi > On 26-Nov-2019, at 2:41 AM, Lorenzo Peña wrote: > > Hello, fellow djangonauts! > > Is there any particular reason why should I pick memcac

Re: Session Variables

2017-05-30 Thread Russell Keith-Magee
Please stop spreading FUD like this. The Django Community Code of Conduct isn’t a blunt instrument attempting to stop all dissent or disagreement. It’s there to ensure that everyone treats everyone else with respect in all communications. The fact that Daniel criticised Hungarian notation is in

Re: Session Variables

2017-05-30 Thread ludovic coues
Pretty sure the django code of conduct is against criticizing the use of Hungarian notation. 2017-05-29 12:29 GMT+02:00 Daniel Roseman : > On Monday, 29 May 2017 06:04:02 UTC+1, James Schneider wrote: >> >> >> On May 28, 2017 9:35 AM, wrote: >> >> >> tFetchData = users.objects.get(emaili

Re: Session Variables

2017-05-29 Thread Daniel Roseman
On Monday, 29 May 2017 06:04:02 UTC+1, James Schneider wrote: > > > On May 28, 2017 9:35 AM, > wrote: > > > tFetchData = users.objects.get(emailid = lEmailId) > > request.session['sPassword'] = tFetchData.userroles > request.session['sCompanyId'] = tFetchData.companyid > >

Re: Session Variables

2017-05-28 Thread James Schneider
On May 28, 2017 9:35 AM, wrote: Dear Experts, I am new to Django and need your help. I want a set of variables populated into session variables. These will be fixed values for the user such as which company he belongs to, his email id, his role etc. These values will be read from the database

Re: Session key is empty after login on Django Channels development server

2017-01-09 Thread Utku Gültopu
It's something about Django. I don't know if it is expected behavior or not, hence I created a ticket . Regards On Monday, January 9, 2017 at 12:25:03 AM UTC+3, Andrew Godwin wrote: > > Hi, > > Have you tried removing the "channels" package from INSTA

Re: Session key is empty after login on Django Channels development server

2017-01-08 Thread Andrew Godwin
Hi, Have you tried removing the "channels" package from INSTALLED_APPS and making sure it fails without that as well? Andrew On Sun, Jan 8, 2017 at 1:43 AM, Utku Gültopu wrote: > When I log a user in using django.contrib.auth.login function, session_key > is sometimes not set in the request of

Re: Session recycling during login times out

2016-02-27 Thread Stodge
The title is misleading; it should probably be "Session recycling stalls during login". I also noticed that logout stalls. On Saturday, February 27, 2016 at 3:12:08 PM UTC-5, Stodge wrote: > > I'm trying to diagnose a problem where noone can login to my django site. > The login attempt times ou

Re: session modification question

2014-01-20 Thread ernando
Hi, I agree with Daniel that your case of using session is incorrect. You have to think about session as a simple dictionary that stores data through requests. And it doesn't keep track about protecting data from changing - you should think about it yourself. Believe, you have to think about so

Re: session modification question

2014-01-18 Thread Daniel Roseman
On Saturday, 18 January 2014 17:11:56 UTC, Spork Spork wrote: > > Hi, > > I have a question about what gets persisted when session data gets > updated. I've read the sessions chapter of the book, and it's not entirely > clear to me. > > Say I have two keys in the session object that I'm manipulat

Re: session data and logout

2013-09-19 Thread Bill Freeman
About the only meaning that "logout" can have on a web site is "this session is no longer valid". The expires stuff has to do with when you don't log out, but don't visit the page again. On Thu, Sep 19, 2013 at 8:54 AM, MikeKJ wrote: > I have this oddball requirement where an authenticated use

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Tom Evans
On Mon, Mar 18, 2013 at 11:30 AM, Philip Goh wrote: > Dear list, > > This is a question that was asked on Stackoverflow more than a week ago, but > I haven't had an answer so I am posting this to the Django mailing list as > well. > http://stackoverflow.com/questions/15338103/django-session-values

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Philip Goh
On Monday, 18 March 2013 15:11:10 UTC, Shawn Milochik wrote: > > Do you have SESSION_SAVE_EVERY_REQUEST enabled? > > > https://docs.djangoproject.com/en/1.4/topics/http/sessions/#session-save-every-request > > I currently do not have it enabled. I have tried enabling it and it did not make an

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Shawn Milochik
Do you have SESSION_SAVE_EVERY_REQUEST enabled? https://docs.djangoproject.com/en/1.4/topics/http/sessions/#session-save-every-request -- 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

Re: session is not expiring

2013-02-21 Thread Jani Tiainen
I'm not sure but I think if you have background processes on and running in Chrome it doesn't actually ever close browser. Excerpt from : "Under advanced settings I unchecked 'Continue running background apps w

Re: Session resets - help me find the bug.

2012-03-21 Thread Daniel Roseman
On Wednesday, 21 March 2012 11:12:09 UTC-7, Daniel Sokolowski wrote: > > Hi All, > > I have the following code: http://dpaste.com/719654/ for a session > based cart implementation I've created. I run into an odd bug/issue > that I can't figure out, when I create or retrieve the Cart instance >

Re: [Session] [Bangalore - India] Python & Django – Introduction & Demo

2012-02-08 Thread yati sagade
Sorry, That is, do you guys *have* any similar plans for Kolkata? On Wed, Feb 8, 2012 at 11:21 PM, yati sagade wrote: > Great news! would love to be there - Do you plans for something similar in > Kolkata? > > > On Wed, Feb 8, 2012 at 8:31 PM, Sivasubramaniam Arunachalam < > sivasubramania...@gm

Re: [Session] [Bangalore - India] Python & Django – Introduction & Demo

2012-02-08 Thread yati sagade
Great news! would love to be there - Do you plans for something similar in Kolkata? On Wed, Feb 8, 2012 at 8:31 PM, Sivasubramaniam Arunachalam < sivasubramania...@gmail.com> wrote: > Hi All, > > There is a Django introduction session with demo scheduled in Bar Camp > 2012. > > *Venue : SAP Labs

RE: session expire

2011-10-19 Thread kenneth gonsalves
On Wed, 2011-10-19 at 08:52 +0200, Peio Ziarsolo wrote: > Could some one tell me which tool do you use to debug with django. > Thanks in advance print statements. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To

RE: session expire

2011-10-19 Thread Peio Ziarsolo
Hi, I am still with the same problem. Most of the times django is a black box for me. I have never use a good tool to debug a django project. I thinsk that this is my bigest problem, without that I won't be able to solve this kind of problems. Could some one tell me which tool do you use to

Re: Session value persistence between views

2011-09-07 Thread alaric
Hi: Thanks for the reply. Actually, really dumb mistake, of course. I was using the default django login view to authenticate, which means that my view called "login" was never storing the session value! Once I used my own login view, I was able to store my values correctly. On Sep 7, 5:11 am, bru

Re: Session value persistence between views

2011-09-07 Thread bruno desthuilliers
On Sep 6, 10:42 am, alaric wrote: > Hi: > I am very new to Django but I am trying to authenticate using Django's > session framework. > Problem is: I need the raw password to ssh as that user to retrieve > data on another machine. I haven't gotten it to work however. > > I have a login view that l

Re: session and caching

2011-07-13 Thread het.oosten
As always afterwards everything is very logical :-) Never used caching before. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to dja

Re: session and caching

2011-07-13 Thread Cal Leeming [Simplicity Media Ltd]
want to cache every > single user, but all user using the same layout) > > Then create a new middleware, that uses your both new created > CacheMiddlewares. See django.middleware.cache.py > > > > > > > > > > > > > > > > >reply to messa

Re: session and caching

2011-07-13 Thread het.oosten
> > > > > > > > >reply to message: > >date: 13.07.2011 08:08:31 > >from: "het.oosten" > >to: "Django users" > >subject: [] Re: session and caching > > >> Are you sure because in the docs I find the opposite. > >

RE: [] Re: session and caching

2011-07-13 Thread Henrik Genssen
created CacheMiddlewares. See django.middleware.cache.py >reply to message: >date: 13.07.2011 08:08:31 >from: "het.oosten" >to: "Django users" >subject: [] Re: session and caching > > > > >> Are you sure because in the docs I find the opposite.

Re: session and caching

2011-07-13 Thread het.oosten
> Are you sure because in the docs I find the opposite. > When I read it correct this is about caching the session. I was referring to (or trying to) caching the entire webpage using a custom session key for the lay-out (I use memcached) When I look at the request headers my custom session key,

Re: session and caching

2011-07-13 Thread Jonas Geiregat
> I have site with with a lay-out depending on a session, set in my > view. I first tried site-wide caching, and this obviously didn't work. > The caching is not session aware, and the lay-out changes almost > randomly. Are you sure because in the docs I find the opposite. https://docs.djangopr

Re: session handling

2011-05-20 Thread Tom Evans
On Fri, May 20, 2011 at 12:56 AM, man_kum wrote: > Hello , > > I am new to Django and trying to handle signin/ signout request > according to following documentation > > http://docs.djangoproject.com/en/1.3/topics/auth/#how-to-log-a-user-in > > > I am using fiddler tool on windows for testing the

Re: Session issues in Internet Explorer

2010-10-19 Thread Daniel Roseman
On Oct 19, 3:13 pm, Quiet Light Development wrote: > Hello, > > I am having trouble getting sessions to work with my production > server. When I move from one page to the next and try to call > request.session["app"] it is giving me a key error even though I know > I had set it in the previous pag

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ?.?. 2010, at 22:25, Tom Evans wrote: The server is running Apache 2.2.12 on Ubuntu. >>> >>> You are running in a threaded environment then, your sessions can't persist >>> without cookies or equivalent external storage because the HTTP exchange is >>> not all contained within the s

Re: Session issues in Internet Explorer

2010-10-19 Thread Tom Evans
2010/10/19 Jonathan Barratt : > > On 19 ต.ค. 2010, at 21:49, Jonathan Barratt wrote: > >> >> On 19 ต.ค. 2010, at 21:32, Quiet Light Development wrote: >> >>> Thank you Masklinn and Jonathan for your responses. I don't know a lot >>> about the physical set-up of the system, I can ask the server >>>

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
Ben, Yes, that is definitely going to be the quickest way to resolve your issue, and I see no reason not to use them - Django hashes the data in them so it's safe from casual prying... Hth, Jonathan ? 19 ?.?. 2553 21:54 Ben Luedtke ?: > Thanks Jonathan, > > Either way though, the s

Re: Session issues in Internet Explorer

2010-10-19 Thread Ben Luedtke
Thanks Jonathan, Either way though, the solution is to set the cookie to allow the session to persist correct? Thanks, Ben On Oct 19, 9:51 am, Jonathan Barratt wrote: > On 19 ต.ค. 2010, at 21:49, Jonathan Barratt wrote: > > You are running in a threaded environment then, your sessions can't pe

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ?.?. 2010, at 21:49, Jonathan Barratt wrote: > > On 19 ?.?. 2010, at 21:32, Quiet Light Development wrote: > >> Thank you Masklinn and Jonathan for your responses. I don't know a lot >> about the physical set-up of the system, I can ask the server >> administrators that question. >> >> T

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ต.ค. 2010, at 21:32, Quiet Light Development wrote: > Thank you Masklinn and Jonathan for your responses. I don't know a lot > about the physical set-up of the system, I can ask the server > administrators that question. > > The server is running Apache 2.2.12 on Ubuntu. You are running i

Re: Session issues in Internet Explorer

2010-10-19 Thread Quiet Light Development
Thank you Masklinn and Jonathan for your responses. I don't know a lot about the physical set-up of the system, I can ask the server administrators that question. The server is running Apache 2.2.12 on Ubuntu. Thanks, Ben On Oct 19, 9:20?am, Jonathan Barratt wrote: > ?On 19 ?.?. 2010, at 21:13,

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ต.ค. 2010, at 21:13, Quiet Light Development wrote: > Hello, > > I am having trouble getting sessions to work with my production > server. When I move from one page to the next and try to call > request.session["app"] it is giving me a key error even though I know > I had set it in the pre

Re: Session issues in Internet Explorer

2010-10-19 Thread Masklinn
On 2010-10-19, at 16:13 , Quiet Light Development wrote: > I'm not using cookies at all presently, but trying to track sessions > through the database. This is only the server-side storage of the session, you still need a way to match a given client and its session, and that's generally done via a

Re: Session not working as i had hoped

2010-05-26 Thread Masklinn
On 2010-05-26, at 15:02 , Nuno Maltez wrote: > > http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views > > >>if request.session.get('has_visited',True): > > You're passing True as the default value to the get method - get(key, > default=None); this means that w

Re: Session not working as i had hoped

2010-05-26 Thread daniels
Also move : request.session['has_visited'] = True above the return statement. On May 26, 4:02 pm, Nuno Maltez wrote: > http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sess... > > >    if request.session.get('has_visited',True): > > You're passing True as the default value to th

Re: Session not working as i had hoped

2010-05-26 Thread Nuno Maltez
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views >    if request.session.get('has_visited',True): You're passing True as the default value to the get method - get(key, default=None); this means that when 'has_visited' isn't set in your session (1st visit) it st

Re: Session not working as i had hoped

2010-05-26 Thread Jirka Vejrazka
Hi, a simple hint: try to point out a place in your code where has_visited does exist and is set to False. Also, you probably don't want to have any code in your view after an unconditional "return" statement - that code would never get executed. HTH Jikra -- You received this messa

Re: session key

2010-02-26 Thread Sumanth
Thanks David, Makes sense . On Feb 26, 9:39 am, David De La Harpe Golden wrote: > On 26/02/10 16:50, Sumanth wrote: > > > Hi , > > > I was trying to access the session key using request.session object in > > django.  To do this we can use > > request.session._session_key or request.session.sessi

Re: session key

2010-02-26 Thread David De La Harpe Golden
On 26/02/10 16:50, Sumanth wrote: Hi , I was trying to access the session key using request.session object in django. To do this we can use request.session._session_key or request.session.session_key out of this which is the right one to use ? The latter, without the leading underscore. This

Re: Session errors with mod_wsgi

2010-02-14 Thread birkin
David, A while ago I had a serialization error that may be relevant to your situation. Parts of the request object related to mod_wsgi were not serializable. Below is how I handled it (this is a views.py def). -Birkin [start] def variables( request, SSL=None ): from django.utils import simplej

Re: Session errors with mod_wsgi

2010-02-14 Thread Graham Dumpleton
You are somehow trying to pickle the WSGI environ dictionary, possibly due to trying to pickle the Django request object. You cannot do that. Graham On Feb 14, 2:04 pm, DavidMck wrote: > I've given up. There seems to be an issue with pickling some objects > when you're using mod_wsgi - rather th

Re: Session errors with mod_wsgi

2010-02-13 Thread DavidMck
I've given up. There seems to be an issue with pickling some objects when you're using mod_wsgi - rather than using xlrd, I just attempted to add the uploaded file (small file held in memory) to the session data. The error log was essentially the same, but complaining about an attempt to pickle a C

Re: Session errors with mod_wsgi

2010-02-13 Thread DavidMck
Hmm: My relevant codes seems to be: @login_required def upload(request): if request.method == "POST": form = ExcelUploadForm(request.POST, request.FILES) if form.is_valid(): request.session['sheet'] = form.cleaned_data["excelfile"] If I put something boring into t

Re: Session cache backend or cache API failure

2010-01-04 Thread Ales Zoulek
Hello, I've the same problem there.. Did you find out any solution? Or at least the source of the problem? Regards, Ales -- Ales Zoulek Jabber: ales.zou...@gmail.com -- On Sat, Oct 3, 20

Re: Session problem?

2009-08-28 Thread David
Hi Angel, Thanks so much for your prompt reply. Appreciated. Reading your script, I can see that you use my_id=request.user.id. In my code I used username = request.user.username. (notice my commented code? I just tested request.user.id. The problem exists.) So there is no major difference as i

Re: Session problem?

2009-08-28 Thread Angel Cruz
Your implementation is dependent upon session cookies, and I am sure you have a good reason for it. I am as stomped as you are why that is (unless you are like me, who confuses 127.0.0.1:8080 w/ localhost as I open multiple browsers in testing my site...each will have different session cookies).

Re: Session problem?

2009-08-28 Thread David
Hi Angel, Thanks for your reply. I just tested with decorator @login_required. The problem still exists. Following is script for my homepage. # this is the homepage @login_required def my_view(request): if request.session.test_cookie_worked(): #username = request.user.username

Re: Session problem?

2009-08-28 Thread Angel Cruz
How does your view.py look like? I use the decorator @login_required right before each def that I want to ensure is viewable only to the logged-in user. On Fri, Aug 28, 2009 at 12:00 PM, David wrote: > > hello Django community, > > I met this problem and can not find a solution. I wonder if any

Re: Session problem

2009-07-27 Thread Subramanyam Vemu
Hi Boris Can you update the code/snippet that you are using coz I faced a similar issue while I was working on a project On Sun, Jul 26, 2009 at 4:06 AM, Boris Ozegovic wrote: > > At the moment I am experiencing difficulties with Django session > middleware. For some reason, my keys (and with

Re: Session ID generated each time web server is restarted

2009-05-26 Thread msoulier
On May 15, 11:42 am, Spk wrote: > It seems that everytime I restart the web server, I get a new session > ID which is why it thinks that there is data to be commited. The > browser still has the cookie for the previous session ID, and it is > stored in the database, so why is Django generating a

Re: session through redirects

2009-05-12 Thread Iqbal Abdullah
Hi George, Thank you for the response. I just realised that there was a bug in my code and now it works as expected. >From the link you gave, it also refreshed my mind and made me remember that sessions are saved in the db when request.session is changed, so it has no relation to the request obj

Re: session through redirects

2009-05-12 Thread George Song
On 5/12/2009 5:45 AM, Iqbal Abdullah wrote: > I'm confused on how to get data in request.session if a certain view > redirects the user using HttpResponseRedirect() > > A sample code: > > def view_start(request): > try: > Member(id) > except Exception, e: >

Re: Session and models.

2009-04-28 Thread Liubomir.Petrov
Found it. It was my mistake using an custom class for grouping the data into the session. solved after adding this to the class definition: def __getstate__(self): return [self.var1, self.var2] def __setstate__(self, state): self.var1 = state[0]

Re: Session and models.

2009-04-28 Thread Liubomir.Petrov
Note: I didnt tested with django.core.serializers, because as it seems they only serialize a result from queryset and i need a simple row like: class Root(models.Model): pass # example only class Child(Models.model): child = models.ForeignKey(Root) .. So Root is saved in the session but

Re: session vars or User in templatetags

2009-03-03 Thread Alex Gaynor
On Tue, Mar 3, 2009 at 4:57 PM, Bobby Roberts wrote: > > > on my template i have: > > > > {% au.id|getbidstatus %} > > > > if i try {% au.id|getbidstatus(request.user.id) %}, I get this: > > > > Could not parse the remainder: '(request.user.id)' from 'au.id| > > getbidstatus(request.user.id)' >

Re: session vars or User in templatetags

2009-03-03 Thread Bobby Roberts
> on my template i have: > > {% au.id|getbidstatus %} > > if i try {% au.id|getbidstatus(request.user.id) %},  I get this: > > Could not parse the remainder: '(request.user.id)' from 'au.id| > getbidstatus(request.user.id)' ok ... I'M LOOKING AT THE DOCS and i'm closer but it's only doing the l

Re: session vars or User in templatetags

2009-03-03 Thread Bobby Roberts
> You need to pass request.user.id to the templatetag, nothing automatically > has access to the current user or the current request. hi alex - on my template i have: {% au.id|getbidstatus %} if i try {% au.id|getbidstatus(request.user.id) %}, I get this: Could not parse the remainder: '(req

Re: session vars or User in templatetags

2009-03-03 Thread Alex Gaynor
On Tue, Mar 3, 2009 at 4:17 PM, Bobby Roberts wrote: > > I need to be able toaccess request.user.id in a template tag. Here > is what i'm importing: > > > from django import template > from django.contrib.auth.models import User > from django.template.defaultfilters import stringfilter > impor

Re: Session variables

2009-02-03 Thread Malcolm Tredinnick
On Tue, 2009-02-03 at 13:52 -0800, Vladimir Shulyak wrote: > Any progress on this problem? > I've got exactly the same problem with sessions on ubuntu/database- > backend sessions. But the most interesting thing that variables like > instances of large classes are deleted while simple instances li

Re: Session variables

2009-02-03 Thread Vladimir Shulyak
Any progress on this problem? I've got exactly the same problem with sessions on ubuntu/database- backend sessions. But the most interesting thing that variables like instances of large classes are deleted while simple instances like integers are fine. class Cart(): items = {} to

Re: Session Variables as Default Form Values

2009-02-02 Thread Ty
Ah, DURR. I just had to put "initial=" before the dictionary. Now it all makes sense! On Feb 2, 9:48 pm, Ty wrote: > Yes, but that would bound the data to the form and the data would try > to be validated on page load. I'm looking to pass default values to an > unbound form. > > On Jan 30, 7:13 

Re: Session Variables as Default Form Values

2009-02-02 Thread Ty
Yes, but that would bound the data to the form and the data would try to be validated on page load. I'm looking to pass default values to an unbound form. On Jan 30, 7:13 pm, "Todd O'Bryan" wrote: > You can pass data to a form class as a dictionary, so just save a > dictionary of the values in

Re: Session Variables as Default Form Values

2009-01-30 Thread Todd O'Bryan
You can pass data to a form class as a dictionary, so just save a dictionary of the values in your session under some name that you'll know to use. On Fri, Jan 30, 2009 at 5:04 PM, Tyler Brownell wrote: > http://groups.google.com/group/django-users/browse_thread/thread/ed74391560c762bb > > On Fr

Re: Session Variables as Default Form Values

2009-01-30 Thread Tyler Brownell
http://groups.google.com/group/django-users/browse_thread/thread/ed74391560c762bb On Fri, Jan 30, 2009 at 5:03 PM, Ty wrote: > I've went through the documentation for "modelforms" and "forms" but I > couldn't figure our how someone would set the default value for a form > field to a session vari

Re: Session variables

2009-01-09 Thread bradders
No this is Linux (SUSE10), runing behind Apache and not filesystem. John On Jan 9, 1:27 am, Malcolm Tredinnick wrote: > On Thu, 2009-01-08 at 05:12 -0800, bradders wrote: > > I will try to put something together. I have a fairly detailed trace > > that I have put in thesessioncode that show

Re: Session variables

2009-01-08 Thread Malcolm Tredinnick
On Thu, 2009-01-08 at 05:12 -0800, bradders wrote: > I will try to put something together. I have a fairly detailed trace > that I have put in the session code that shows my session variables > are set when it calls one of my views, but the trace shows that the > next session save only a new ses

Re: Session variables

2009-01-08 Thread bradders
I will try to put something together. I have a fairly detailed trace that I have put in the session code that shows my session variables are set when it calls one of my views, but the trace shows that the next session save only a new session variable set in that view exists all the other session

Re: Session variables

2009-01-08 Thread Malcolm Tredinnick
On Thu, 2009-01-08 at 02:30 -0800, bradders wrote: > Can anyone recommend a session system that works more reliably than > the built-in Django session handling? I am finding that after calling > 2 or 3 different views the session variables that were stored at login > time get cleared. I am using

Re: Session based messages without touching DB

2008-12-05 Thread Andre P LeBlanc
Sorry, I didn't notice that you said you didn't like the DB hits associated with the session based approach, you can use memcached sessions, or file-backed if avoid the database hits. :P On Dec 5, 12:33 pm, Andre P LeBlanc <[EMAIL PROTECTED]> wrote: > What about the patches on the ticket?  The co

Re: Session based messages without touching DB

2008-12-05 Thread Andre P LeBlanc
What about the patches on the ticket? The cookie-based approach is not the right way to do it, as the comments on that page indicate, these things should be stored server side, especially since it is being unpickled serverside, it leave a larges security hole. (and the encryption he later added

Re: Session lost between two requests from the test client

2008-06-14 Thread ksachdeva
I did not have settings like this but re-organizing my project, installing django again, deleting and creating the database made the issue disappear. This implies that it must be my fault. Thanks for all the help and time you guys spent on my problem. I am very sure that I am going to enjoy the

Re: Session lost between two requests from the test client

2008-06-13 Thread Norman Harman
ksachdeva wrote: > Hi, > > From a testcase I first issue a 'get' request to a view (say view1) > where I set a request.session['m_key'] = 'myval'. Now I issue a 'post' > request to a view (say view2). In view2, I tried to obtain > request.session['m_key'] but I get an error that session does not

Re: Session lost between two requests from the test client

2008-06-12 Thread ksachdeva
Unfortunately it didn't. I applied your patches and tried my unit test but with out success. Currently I am storing the sessions in the database, seeing your example I tried to configure (settings.py) to use files as session store but could not do so. Whatever I specify as SESSION_FILE_PATH I get

Re: Session lost between two requests from the test client

2008-06-12 Thread simonb
I pretty sure this is a subtle bug in the session code. I reported here http://code.djangoproject.com/ticket/6984 There is a patch in the report that you could try. Let me know if it fixes it. Regards Simon --~--~-~--~~~---~--~~ You received this message because

Re: Session lost between two requests from the test client

2008-06-12 Thread ksachdeva
Thanks for the reply. I am currently trying it from the unittests (django test client), I am sure it would work if I use the web site. I also found a ticket that was opened 2 days ago : http://code.djangoproject.com/ticket/7416 which seems to be talking about similar problem. On Jun 13, 12:22 am

Re: Session lost between two requests from the test client

2008-06-12 Thread Peter Rowell
> Would appreciate any help in this regards Try using Firefox and the Live HTTP Headers plugin. Start at the beginning and see what is being exchanged between browser and server. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Session logout behaviour

2008-05-29 Thread Scott Moonen
Louis, there is some value in retaining the session past logout. The decision of what session data to keep/destroy is best left to the application. For any application that allows both anonymous and authenticated access, any site settings that you are able to set as an anonymous user (e.g., font

Re: Session/Varibale and HttpResponseRedirect help please

2008-04-29 Thread Brandon Taylor
Hi Doug, Yes, I'm absolutely certain it's not a browser caching issue. I was concerned that there was something syntactically wrong with my session get/set code that would cause the value not to be stored. Thoughts? Thanks, Brandon On Apr 29, 10:21 am, Doug Van Horn <[EMAIL PROTECTED]> wrote: >

Re: Session/Varibale and HttpResponseRedirect help please

2008-04-29 Thread Doug Van Horn
You may want to make sure your browser cache isn't showing you an old page. Hit F5 a few times, and also make sure your browser settings have the cache at 0MB, so it doesn't cache anything. After that I'd start by adding some print statements after you add the variable to the session and right b

Re: Session/Varibale and HttpResponseRedirect help please

2008-04-28 Thread g m
THANKYOU On 4/29/08, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > I'm doing a redirect after a form to a "thank you" page, which I would > like to personalize with some of the data from the form. I've tried > setting a session as such: > > ### views.py code > > if form.is_va

Re: Session is new every time

2008-04-19 Thread Martin Kaffanke
Am Donnerstag, den 17.04.2008, 17:17 +0200 schrieb Martin Kaffanke: > I use django behind apache using the wsgi like described here: > > http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango Just for those who are interested: It does not work with python2.4 but it works with python2.5 Ma

Re: session data or ???

2008-04-17 Thread Horst Gutmann
Well, you could minimize the amount of code you will have to repeat for each and every view function by doing some OOP. For instance you could probably do something like this in your views.py: class AbstractView(object): def __init__(self, request, *args, **kwargs): # Do some generic

Re: session data or ???

2008-04-16 Thread [EMAIL PROTECTED]
great, thank you very much Horst now it is working, but still have some question please. for instance in my views.py i have: index_globals={} Class Test: init and some more data def homepage(request): some code with variables index_globals['info'] = user_sys

Re: session data or ???

2008-04-15 Thread Horst Gutmann
Well, depending on how you handle this "variable" you have multiple options: 1. Store it into the session using request.session['info'] = info and retrieve it later from the session when you want to use this data. 2. If you also want to keep this "choice" permanently associated with the user, I'd

Re: session data or ???

2008-04-15 Thread [EMAIL PROTECTED]
ok i will try to explain. when i or whoever visit homepage, the method from views.py generates some data, for example info about operating system or whatever, just some value stored in variable or dict, let's call it info = {'system': 'unix'} later when user is browsing the site, he/she visits

Re: session data or ???

2008-04-15 Thread Horst Gutmann
Why do you want to manipulate just a specific session that might not even be an existing sesion anymore? And for what reason do you want to give other views the same data as the last view that's been used? To me this sounds just like using a normal session (as provided by request.session) ... Cou

  1   2   >