Re: Cookies not showing up in environ

2018-07-26 Thread abc abc
Yes, this was the problem. At some point early in my attempts I got the idea that linking up Django to a production web server required writing a separate wsgi.py script. Wrong. Replaced the wsgi.py with the default Django wsgi.py for the project and everything seems resolved. Thank you. --

Re: Cookies not showing up in environ

2018-07-21 Thread Jon Ribbens
On 2018-07-21, abc abc wrote: >> I think one of the main issues is that you don't seem to have decided >> whether you're writing a WSGI application or a Django application. > > Yes, I suppose I thought Django had to use wsgi to process requests, > I didn't know there were 'two' options here.

Re: Cookies not showing up in environ

2018-07-21 Thread abc abc
> I think one of the main issues is that you don't seem to have decided > whether you're writing a WSGI application or a Django application. Yes, I suppose I thought Django had to use wsgi to process requests, I didn't know there were 'two' options here. Does your example represent one or the

Re: Cookies not showing up in environ

2018-07-21 Thread abc abc
> I think one of the main issues is that you don't seem to have decided > whether you're writing a WSGI application or a Django application. Yes, I suppose I thought Django had to use wsgi to process requests, I didn't know there were 'two' options here. Does your example represent one or the

Re: Cookies not showing up in environ

2018-07-21 Thread Jon Ribbens
On 2018-07-20, abc abc wrote: > Well, I'm so messed up between so many sources and tutorials I don't > know which way is up. I think one of the main issues is that you don't seem to have decided whether you're writing a WSGI application or a Django application. WSGI: def

Re: Cookies not showing up in environ

2018-07-20 Thread abc abc
Well, I'm so messed up between so many sources and tutorials I don't know which way is up. References to environ variable: https://www.python.org/dev/peps/pep-0333/ https://stackoverflow.com/questions/16774952/wsgi-whats-the-purpose-of-start-response-function I read that I have to have a file

Re: Cookies not showing up in environ

2018-07-20 Thread Peter J. Holzer
On 2018-07-20 12:39:38 -0700, abc abc wrote: > I am trying the simplest of examples below to set and read a cookie. I > am using the Django framework, but I have also tried with vanilla > python cookies and os.environ. I have posted elsewhere, but this > hasn't gotten much attention, so I'd really

Re: Cookies not showing up in environ

2018-07-20 Thread Calvin Spealman
You can read cookies from the request via the request.COOKIES dictionary. See the documentation here: https://docs.djangoproject.com/en/2.0/ref/request-response/#django.http.HttpRequest.COOKIES You won't find them in an environment variable, which is shared process-wide and across all requests,

Re: Cookies

2009-12-31 Thread Victor Subervi
On Thu, Dec 31, 2009 at 1:10 AM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: You know, neither one of those tutorials I followed gave clear, or any, instruction about putting a print cookie statement in the header! How misleading! Don't blame the tutorials for

Re: Cookies

2009-12-31 Thread Victor Subervi
I'm curious. Are there other instances where code needs to be inserted into the header as in the print cookie to get it to be baked on the user's PC? TIA, beno -- http://mail.python.org/mailman/listinfo/python-list

Re: Cookies

2009-12-30 Thread Victor Subervi
On Tue, Dec 29, 2009 at 3:43 PM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: Hi; I have these lines: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain, cMaxAge, cVersion =

Re: Cookies

2009-12-30 Thread Carsten Haese
Victor Subervi wrote: On Tue, Dec 29, 2009 at 3:43 PM, Carsten Haese carsten.ha...@gmail.com mailto:carsten.ha...@gmail.com wrote: You apparently haven't followed the tutorials carefully enough. You do know that a cookie is a piece of information that's stored in your browser,

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 9:56 AM, Carsten Haese carsten.ha...@gmail.comwrote: So, guess again. The trivial example has three more lines of code. One of them is unlike any line you have in your code. That's the line responsible for producing the Set-Cookie header, and that's the line you're

Re: Cookies

2009-12-30 Thread Carsten Haese
Victor Subervi wrote: Here again is my code: #! /usr/bin/python import string import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login import datetime, Cookie, random from particulars import title from templateFrame

Re: Cookies

2009-12-30 Thread Steve Holden
Carsten Haese wrote: Victor Subervi wrote: [...] Pardon me for not being able to read your mind. The code you're now posting is significantly more code than your first post included. The line that I had determined to be missing is in fact not missing, you just didn't bother to post your

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 11:54 AM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: Here again is my code: #! /usr/bin/python import string import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 12:19 PM, Steve Holden st...@holdenweb.com wrote: Carsten Haese wrote: I will point out again, without the least expectation that it will do any good, that the reason this problem has occurred is that Victor simply refuses to take the time to absorb the principles of

Re: Cookies

2009-12-30 Thread Carsten Haese
Victor Subervi wrote: I've revised the code thus: cookie = os.environ.has_key('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time())

Re: Cookies

2009-12-30 Thread Carsten Haese
Victor Subervi wrote: Comments from a left-brain thinker without any concept of how difficult it is for a right-brain thinker to think like you. Care to compare poetry? I'd bury you. That may be so, but the difference is that Steve is not trying to earn a living writing poetry as far as I

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 12:43 PM, Carsten Haese carsten.ha...@gmail.comwrote: Anyway, the likely answer is that you guessed incorrectly. As I said before, you need to make sure that the cookie is printed as part of the page headers. I'll give you one last hint: The page header is where you're

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 12:51 PM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: Comments from a left-brain thinker without any concept of how difficult it is for a right-brain thinker to think like you. Care to compare poetry? I'd bury you. That may be so, but the

Re: Cookies

2009-12-30 Thread Victor Subervi
On Wed, Dec 30, 2009 at 12:51 PM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: Comments from a left-brain thinker without any concept of how difficult it is for a right-brain thinker to think like you. Care to compare poetry? I'd bury you. That may be so, but the

Re: Cookies

2009-12-30 Thread Victor Subervi
You know, neither one of those tutorials I followed gave clear, or any, instruction about putting a print cookie statement in the header! How misleading! beno -- http://mail.python.org/mailman/listinfo/python-list

Re: Cookies

2009-12-30 Thread Steve Holden
Victor Subervi wrote: You know, neither one of those tutorials I followed gave clear, or any, instruction about putting a print cookie statement in the header! How misleading! beno At the risk of repeating myself, if you understood more about what you are trying to do you wouldn't have

Re: Cookies

2009-12-30 Thread Carsten Haese
Victor Subervi wrote: You know, neither one of those tutorials I followed gave clear, or any, instruction about putting a print cookie statement in the header! How misleading! Don't blame the tutorials for your failure to read them carefully. The tutorial you mentioned

Re: Cookies

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: Hi; I have these lines: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) cookie['lastvisit']['expires']

Re: Cookies and CookieJar

2008-05-17 Thread 7stud
On May 16, 9:21 am, Larry Bates [EMAIL PROTECTED] wrote: I'm struggling with a project using mechanize and cookies to screen scape a website.  The site requires a client created cookie for authentication.  Below is the code I'm attempting to use with the traceback I'm getting:   import Cookie

Re: Cookies and CookieJar

2008-05-17 Thread 7stud
Larry Bates wrote: I'm struggling with a project using mechanize and cookies to screen scape a website. The site requires a client created cookie for authentication. Are you sure that is correct? As far as I know, the usual course of events is for a site to set a cookie header in the response