was just trying the original code raw in a python terminal - here's what i get:
>>> curdir = os.path.dirname(__file__) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name '__file__' is not defined >>> i did a dir() to double check, it's in there (python version 2.6.35 >>> dir(os.path) ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_resolve_link', '_varprog', 'abspath', 'altsep', 'basename', 'commonprefix', 'curdir', 'defpath', 'devnull', 'dirname', 'exists', 'expanduser', 'expandvars', 'extsep', 'genericpath', 'getatime', 'getctime', 'getmtime', 'getsize', 'isabs', 'isdir', 'isfile', 'islink', 'ismount', 'join', 'lexists', 'normcase', 'normpath', 'os', 'pardir', 'pathsep', 'realpath', 'relpath', 'samefile', 'sameopenfile', 'samestat', 'sep', 'split', 'splitdrive', 'splitext', 'stat', 'supports_unicode_filenames', 'walk', 'warnings'] On Tue, Sep 14, 2010 at 9:28 PM, Greg Milby <[email protected]> wrote: > well, i got to try it out - still an internal error > http://milby.no-ip.org/quotes > > <http://milby.no-ip.org/quotes>here's how i changed the code: > curdir = '/var/www/python/quotes #os.path.dirname(__file__) > session = web.session.Session(app, web.session.DiskStore(curdir + '/' + > 'sessions'),) > > application = app.wsgifunc() > > the path/dir appear to be correct > drwxr-xr-x 3 gmilby gmilby 4096 2010-09-14 14:42 backups > -rw-r--r-- 1 gmilby gmilby 3 2010-09-14 13:37 blank > -rwxr-xr-x 1 gmilby gmilby 25782 2010-09-14 20:26 code_quotes.py > -rwxrwxr-x 1 gmilby gmilby 1406 2010-09-14 13:37 favicon.ico > -rw-r--r-- 1 gmilby gmilby 0 2010-09-14 14:42 index.html > -rw-r--r-- 1 gmilby gmilby 4311 2010-09-14 13:37 pager.py > -rw-r--r-- 1 gmilby gmilby 6321 2010-09-14 13:37 pager.pyc > -rw-r--r-- 1 gmilby gmilby 1748 2010-09-14 13:37 quote_feed.py > -rw-r--r-- 1 gmilby gmilby 997 2010-09-14 13:37 quotes.xml > drwxrwxrwx 2 gmilby gmilby 4096 2010-09-14 21:25 sessions > drwxr-xr-x 7 gmilby gmilby 4096 2010-09-14 14:42 static > drwxr-xr-x 4 gmilby gmilby 4096 2010-09-14 15:40 templates > -rwxrwxrwx 1 gmilby gmilby 5152 2010-09-14 13:37 visitors.txt > drwxr-xr-x 6 gmilby gmilby 4096 2010-09-14 14:42 > whole_site_backup_playing_with_nav18AUG2010 > gmi...@mini64:/var/www/python/quotes$ > > On Tue, Sep 14, 2010 at 5:10 PM, Greg Milby <[email protected]> wrote: > >> Good idea - will try that when I land:) >> >> ::Sent from my Verizon HTC incredible gOS:: >> >> On Sep 14, 2010 4:05 PM, "Justin Davis" <[email protected]> wrote: >> > The session code tries to create a directory if it doesn't exist. This >> > means that your code it being run from a different path than you >> > think. >> > >> > Try specifiying the absolute path to DiskStore -- like DiskStore("/var/ >> > www/mypath/sesssions") instead of a relative path. >> > >> > On Sep 14, 12:04 pm, Greg Milby <[email protected]> wrote: >> >> drwxrwxrwx 2 gmilby gmilby 4096 2010-09-14 14:26 sessions >> >> >> >> >> >> >> >> On Tue, Sep 14, 2010 at 2:51 PM, m g <[email protected]> wrote: >> >> > What are the permissions for the folder containing "sessions" ? >> >> >> >> > -- >> >> > You received this message because you are subscribed to the Google >> Groups >> >> > "web.py" group. >> >> > To post to this group, send email to [email protected]. >> >> > To unsubscribe from this group, send email to >> >> > [email protected]<webpy%[email protected]>< >> webpy%[email protected]<webpy%[email protected]> >> >. >> >> > For more options, visit this group at >> >> >http://groups.google.com/group/webpy?hl=en. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "web.py" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> [email protected] <webpy%[email protected]> >> . >> > For more options, visit this group at >> http://groups.google.com/group/webpy?hl=en. >> > >> > > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
