[web2py] Is it possible to LOAD a component after a page has rendered?

2012-01-28 Thread scausten
I'd like to asynchronously load one of a choice of components into a
view, based on a user selection after the page has loaded. It's
relatively trivial to do this by changing the src on an iFrame which
embeds the component view, but this doesn't feel like a web2py-ish way
of doing things.

It would be great to be able to do something like pass the component
to the view in the form something like (obviously this is currently
impossible):

LOAD('controller','function.load',target='componentTarget',deferRender=True)

Then do a js call:

$('#componentTarget').render()

to create the component on the page.

Any ideas?


[web2py] Re: Is it possible to LOAD a component after a page has rendered?

2012-01-28 Thread apple
web2py_ajax_page("get", URL, null , DIV_ID)

This function is included in web2py.js

On Jan 28, 10:03 am, scausten  wrote:
> I'd like to asynchronously load one of a choice of components into a
> view, based on a user selection after the page has loaded. It's
> relatively trivial to do this by changing the src on an iFrame which
> embeds the component view, but this doesn't feel like a web2py-ish way
> of doing things.
>
> It would be great to be able to do something like pass the component
> to the view in the form something like (obviously this is currently
> impossible):
>
> LOAD('controller','function.load',target='componentTarget',deferRender=True )
>
> Then do a js call:
>
> $('#componentTarget').render()
>
> to create the component on the page.
>
> Any ideas?


[web2py] Re: Is it possible to LOAD a component after a page has rendered?

2012-01-28 Thread Alan Etkin
You can use javascript onclick and the web2py.js function
web2py_component(action,target) to load the source on demand.
You need to set a target div or other element in the view previously
and get the triggered event's DOM element id with jQuery to pass it
with the url/action string.


[web2py] DAL and date calculations

2012-01-28 Thread Ed Greenberg
Using the DAL, I'd like to select records that are less than some
interval old, or newer than a certain date.  My records have a
datetime field in them.

So I want something like:

select * from table where mydate > (now()-interval 1 day)

Can I do this in the dal, or do I have to use raw sql?

Thanks,

Ed


[web2py] Many apps but only one needs https.

2012-01-28 Thread António Ramos
Hello, if i have 20 apps in the same server of web2py and only one needs to
be accessed with https what do i do?


Thank you

António


Re: [web2py] Re: Chunked downloads and corrupt files with Internet Explorer 8 (IE8)

2012-01-28 Thread Phyo Arkar
its 2.7 as all my servers are (distro default)

On Thu, Jan 26, 2012 at 3:22 PM, Phyo Arkar wrote:

> I am using 1.99.1 and it happens to me frequently. If download is big (
> for my case > 100,200 MB) it usually end up with corrupted file. Tested on
> Local wifi network with 300 Mbps.
>
>
> On Wed, Jun 15, 2011 at 4:21 PM, Stefan Scholl wrote:
>
>> Is nobody else experiencing this problem? Is nobody using Internet
>> Explorer to download more than 64KiB from a web2py app?
>>
>>
>> On 6 Mai, 13:03, Stefan Scholl  wrote:
>> > The classicdownloadfunction:
>> >
>> > defdownload():
>> > return response.download(request, db)
>> >
>> > I'm developing on localhost (127.0.0.1, no SSL) and one strange thing
>> > happened: Downloads in IE8 (Windows XP) were all corrupt/broken if
>> > they weren't below 64KiB in size. Very easy to see with large images.
>> >
>> > Using a higher value for the argument 'chunk_size' solves this
>> > problem, up to this new maximum.
>> >
>> > web2py 1.91.6
>>
>
>


Re: [web2py] DAL and date calculations

2012-01-28 Thread Bruce Wade
today = datetime.date.today()
yesterday = today - datetime.timedelta(1)
today_ads = self.db(db.table.date > yesterday).select().first()

On Sat, Jan 28, 2012 at 6:35 AM, Ed Greenberg wrote:

> Using the DAL, I'd like to select records that are less than some
> interval old, or newer than a certain date.  My records have a
> datetime field in them.
>
> So I want something like:
>
> select * from table where mydate > (now()-interval 1 day)
>
> Can I do this in the dal, or do I have to use raw sql?
>
> Thanks,
>
> Ed
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Problem with the audio tag, web2py and Firefox

2012-01-28 Thread Magnitus
I recently read a book about html 5 and promptly started using some of the 
features described in my project.

I experienced a problem with the audio tag and Firefox which I reduced to a 
minimalistic example illustrating the problem.

*The experiment:*

*1) Control Situation*

I put "Main_theme.webm" and "Main_theme.mp3" in a folder along with 
test.html which is written as follow:



HTML5 Audio



Just because you are getting older doesn't mean your browser has 
to. Go get a recent browser and get a youthful feeling!



The soundtrack plays for Opera, Chrome, IE and Firefox (in Safari, the 
soundtrack doesn't play and the message appears instead which is weird as 
www.caniuse.com lists audio tags as supported in recent versions of safari, 
but anyways, this is a side detail).

*2) Deployment Situation*

I put the "Main_theme.webm" and "Main_theme.mp3" audio files in the 
/static/audio directory.

I use the default Tornado server that comes with the Framework.

I edit the index.html page of the default controller to be:

{{extend 'layout.html'}}



Just because you are getting older doesn't mean your browser has 
to. Go get a recent browser and get a youthful feeling!


Here, the result is the same as the control situation, expect for the fact 
that the soundtrack doesn't play in Firefox.

When I look at the http requests/responses in Firebug, I see a 206 code for 
the audio file request (which is the same as in Chrome, expect that Chrome 
plays it).

So, what is faulty? Me? Firefox? Web2py? The Tornado server? A combination 
of the previous?

Any insights would be welcome.

I won't die if the audio for my app doesn't play with Firefox, but it would 
be nice.


[web2py] ssh tunnel to admin panel with lighttpd=> ERROR:web2py.cache:corrupted file

2012-01-28 Thread Benjamin
Hello guys,

Attracted by web2py dev possibilities I couldn't resist ;-) But
unfortunately deployment is a whole other story and I'm having major
difficulties.

So after a struggle I got web2py to run on lighttpd, then discovered
that, as I didn't set any SSL, I couldn't access the admin interface.

So I'm trying to use an ssh tunnel :
ssh -L 9090:localhost:80 root@192.168.1.101

After that I can see the demo app at localhost:9090 but every single
click on the "Admin interface" button on the right of the demo app end
up with :

on the browser side :
"Internal error
Ticket issued: admin/__1.2012-01-28.23-18-18.cf854d0b-a8f7-4ef8-bd28-
a24debe031a8"

on the terminal side (the terminal which started a bash script
starting the fcgihandler.fcgi ) I got this :
ERROR:web2py.cache:corrupted file /home/www-data/web2py/applications/
admin/cache/cache.shelve, will try delete it!

Interesting fact : each time I try to click on the "admin panel"
button from the browser, a new "ERROR:web2py.cache:corrupted file /
home/www-data/web2py/applications/admin/cache/cache.shelve, will try
delete it!" is displayed on the terminal.

What am I doing wrong ?

Thanks a lot,

cheers,

PS : the file got deleted automatically each time but I still can't
access the admin panel


[web2py] Re: ssh tunnel to admin panel with lighttpd=> ERROR:web2py.cache:corrupted file

2012-01-28 Thread Massimo Di Pierro
Can you try delete applications/admin/cache/*?

it is possible that there is a cache file created using a different
python version and web2py cannot open it. For permission issues it may
be unable to remove it and re-create it.

On Jan 28, 12:25 pm, Benjamin  wrote:
> Hello guys,
>
> Attracted by web2py dev possibilities I couldn't resist ;-) But
> unfortunately deployment is a whole other story and I'm having major
> difficulties.
>
> So after a struggle I got web2py to run on lighttpd, then discovered
> that, as I didn't set any SSL, I couldn't access the admin interface.
>
> So I'm trying to use an ssh tunnel :
> ssh -L 9090:localhost:80 r...@192.168.1.101
>
> After that I can see the demo app at localhost:9090 but every single
> click on the "Admin interface" button on the right of the demo app end
> up with :
>
> on the browser side :
> "Internal error
> Ticket issued: admin/__1.2012-01-28.23-18-18.cf854d0b-a8f7-4ef8-bd28-
> a24debe031a8"
>
> on the terminal side (the terminal which started a bash script
> starting the fcgihandler.fcgi ) I got this :
> ERROR:web2py.cache:corrupted file /home/www-data/web2py/applications/
> admin/cache/cache.shelve, will try delete it!
>
> Interesting fact : each time I try to click on the "admin panel"
> button from the browser, a new "ERROR:web2py.cache:corrupted file /
> home/www-data/web2py/applications/admin/cache/cache.shelve, will try
> delete it!" is displayed on the terminal.
>
> What am I doing wrong ?
>
> Thanks a lot,
>
> cheers,
>
> PS : the file got deleted automatically each time but I still can't
> access the admin panel


[web2py] reload just via ajax (not entire page)

2012-01-28 Thread Vineet
I have an observation.
When we jump from one view to another, the entire page gets reloaded.
Whereas, it should be sufficient to reload just  via
ajax.

Any particular reason as to why the entire page is reloaded every
time?

For my purpose, on every request, how do I load only 
via ajax?


Re: [web2py] reload just via ajax (not entire page)

2012-01-28 Thread Bruce Wade
I am pretty sure every page is reloaded every time is because their is no
guaranty that every single person who uses the framework will use a div
id="page" etc... or the same layout for that matter.

If you want to refresh only the  then you would have to
write your application in a way so it does that. IE: Intercept page clicks
with javascript, and make sure your view contains only the HTML you want to
render inside  don't include the layout template etc.. Then
use jquery to update the html of the  with the new content.

--
Regards,
Bruce

On Sat, Jan 28, 2012 at 12:15 PM, Vineet  wrote:

> I have an observation.
> When we jump from one view to another, the entire page gets reloaded.
> Whereas, it should be sufficient to reload just  via
> ajax.
>
> Any particular reason as to why the entire page is reloaded every
> time?
>
> For my purpose, on every request, how do I load only 
> via ajax?




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: reload just via ajax (not entire page)

2012-01-28 Thread Vineet
Whatever the authorities assigned to users, irrespective of that,
every user will be using the same flash, footer, header, superfish,
etc.
Considering this, why to reload those common divs (which won't change
with different users) & add the overhead?


Re: [web2py] Re: reload just via ajax (not entire page)

2012-01-28 Thread Bruce Wade
Really every user? I don't use the same footer, header or superfish. The
sites I work on are completely different.

On Sat, Jan 28, 2012 at 12:34 PM, Vineet  wrote:

> Whatever the authorities assigned to users, irrespective of that,
> every user will be using the same flash, footer, header, superfish,
> etc.
> Considering this, why to reload those common divs (which won't change
> with different users) & add the overhead?




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Any advice on spam control for a comment system?

2012-01-28 Thread monotasker
I'm about to deploy a simple blog platform for myself and have implemented 
comments using something very much like Massimo's example in the components 
chapter of the web2py book. What I'm wondering about, though, is spam 
control. At the moment I think I'm just going to activate recaptcha for the 
comment submission form. But has anyone got other suggestions? I understand 
that "honeypot" solutions are often effective, but I haven't yet thought 
about how to implement one.

Ian


[web2py] Re: reload just via ajax (not entire page)

2012-01-28 Thread Cliff
How will you degrade for users who have turned off Javascript?

On Jan 28, 3:34 pm, Vineet  wrote:
> Whatever the authorities assigned to users, irrespective of that,
> every user will be using the same flash, footer, header, superfish,
> etc.
> Considering this, why to reload those common divs (which won't change
> with different users) & add the overhead?


[web2py] Re: reload just via ajax (not entire page)

2012-01-28 Thread pbreit
Because that's how 99.9% of websites function.

[web2py] Re: Any advice on spam control for a comment system?

2012-01-28 Thread pbreit
I would suggest avoiding captcha until you prove to yourself that you have 
a problem.

Akismet is targeted at comment spam in particular:
http://akismet.com/

If you do need something, captcha is probably the worst choice you can make 
since it's aggravating to legitimate users.

Here's a simple hidden field explanation:
http://www.ngenworks.com/blog/invisible_captcha_to_prevent_form_spam/


[web2py] Re: model less apps (a blog example)

2012-01-28 Thread pbreit
Interesting, thanks for putting that together. I'm starting to understand 
the other approach better but it is quite a departure from what I do now. 
Look forward to seeing performance results.

Re: [web2py] Web2py in large web scenarios

2012-01-28 Thread Vinicius Assef
I'd use folders inside models.
I think I'd use web2py infrastructure that's already available to me.

And, AFAIK, /modules were not planned for that. Except for pluggable apps.

--
Vinicius Assef.



On Fri, Jan 27, 2012 at 10:35 PM, Bruno Rocha  wrote:

> I am using /models just to define small global functions and to set some
> response and request keys.
>
> All my code including datamodels I  am putting into /modules
>
> In my mind I changed the /models to /scripts or /batches so it is more
> easy to understand why avoiding it.
>
> my current structure is:
>
> /modules/datamodels/someentity.py - Database definitions
>
> /modules/handlers/someentity.py - my code logic and template rendering
>
> /modules/helpers/* - miscelanious
>
> /modules/myappname.py - My.custom Auth, db, Mail, Service etc..
>
> /controllers/someentytity.py - it will just be a point of entry, here I do
> selective imports, intantiate the entities and call the template rendering.
>
> views files can be stored anywhere filesystem or database.
>
> http://zerp.ly/rochacbruno
> Em 27/01/2012 17:48, "Magnitus"  escreveu:
>
> >This is very good advice. I have moved many of my plugins and apps from
>> using models to modules because of the performance gain. There is nothing
>> wrong with the models implementation, but it's really meant to define
>> tables and that's it. Functionality that doesn't belong in a controller
>> should go to modules.<
>>
>> Interesting, so to clarify: are you minimizing the amount of code into
>> the model (limiting it to table definitions) or you avoid using a model at
>> all?
>>
>


Re: [web2py] Web2py in large web scenarios

2012-01-28 Thread Bruno Rocha
submodels are good, but you cant import models. So you cant reuse code. you
end with too much repetition.

in modules you can have a DRY structure.

https://github.com/rochacbruno/web2py_model_less_app

 http://zerp.ly/rochacbruno
Em 28/01/2012 23:00, "Vinicius Assef"  escreveu:

> I'd use folders inside models.
> I think I'd use web2py infrastructure that's already available to me.
>
> And, AFAIK, /modules were not planned for that. Except for pluggable apps.
>
> --
> Vinicius Assef.
>
>
>
> On Fri, Jan 27, 2012 at 10:35 PM, Bruno Rocha wrote:
>
>> I am using /models just to define small global functions and to set some
>> response and request keys.
>>
>> All my code including datamodels I  am putting into /modules
>>
>> In my mind I changed the /models to /scripts or /batches so it is more
>> easy to understand why avoiding it.
>>
>> my current structure is:
>>
>> /modules/datamodels/someentity.py - Database definitions
>>
>> /modules/handlers/someentity.py - my code logic and template rendering
>>
>> /modules/helpers/* - miscelanious
>>
>> /modules/myappname.py - My.custom Auth, db, Mail, Service etc..
>>
>> /controllers/someentytity.py - it will just be a point of entry, here I
>> do selective imports, intantiate the entities and call the template
>> rendering.
>>
>> views files can be stored anywhere filesystem or database.
>>
>> http://zerp.ly/rochacbruno
>> Em 27/01/2012 17:48, "Magnitus"  escreveu:
>>
>> >This is very good advice. I have moved many of my plugins and apps from
>>> using models to modules because of the performance gain. There is nothing
>>> wrong with the models implementation, but it's really meant to define
>>> tables and that's it. Functionality that doesn't belong in a controller
>>> should go to modules.<
>>>
>>> Interesting, so to clarify: are you minimizing the amount of code into
>>> the model (limiting it to table definitions) or you avoid using a model at
>>> all?
>>>
>>
>


[web2py] Usage errors printed to console

2012-01-28 Thread Ross Peoples
I pulled from trunk a week or so ago and ever since, I've been getting this 
every few minutes printed to the console:

WARNING:web2py.cron:WEB2PY CRON Call returned code 2:
-J is reserved for Jython
usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

I am running web2py using this: python web2py.py -a password -i 0.0.0.0

If I add -N, the error goes away. I'm not using cron or anything. I only 
have one app in this web2py instance. Anyone else noticing these errors?


[web2py] Re: reload just via ajax (not entire page)

2012-01-28 Thread Rich
Is there no theming layer in web2py.. just a noob here but this seems
like a theming issue.

Rendering links and such to either reload everything or do an ajax
thing should be handled in the theme...

Best regards,
Rich


On Jan 28, 3:15 pm, Vineet  wrote:
> I have an observation.
> When we jump from one view to another, the entire page gets reloaded.
> Whereas, it should be sufficient to reload just  via
> ajax.
>
> Any particular reason as to why the entire page is reloaded every
> time?
>
> For my purpose, on every request, how do I load only 
> via ajax?


[web2py] Re: Monitoring memory usage & leaks

2012-01-28 Thread Joseph Jude
There is an option -F  while starting web2py. Is there any 
documentation (or pointers) about how to use it?

Thank you,
Joseph
http://www.jjude.biz


[web2py] ticket with book example under 7.2.6 Links to Referencing Records

2012-01-28 Thread DenesL
As reported in the Spanish group, the example under section 7.2.6
Links to Referencing Records, calling the list_records action with a
query var, e.g.:

http://127.0.0.1:8000/test/test/list_records/person?query=person.id>0


Traceback (most recent call last):
  File "C:\w2p\web2py_1.99.4_src\gluon\restricted.py", line 204, in
restricted
exec ccode in environment
  File "C:/w2p/web2py_1.99.4_src/applications/test/controllers/
test.py", line 34, in 
  File "C:\w2p\web2py_1.99.4_src\gluon\globals.py", line 172, in

self._caller = lambda f: f()
  File "C:/w2p/web2py_1.99.4_src/applications/test/controllers/
test.py", line 30, in list_records
records = db(query).select(db[table])
  File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 6333, in select
return self.db._adapter.select(self.query,fields,attributes)
  File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1274, in select
sql = self._select(query, fields, attributes)
  File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1672, in _select
sql = super(SQLiteAdapter, self)._select(query, fields,
attributes)
  File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1155, in _select
if query and not query.ignore_common_filters:
AttributeError: 'str' object has no attribute 'ignore_common_filters'

The code to reproduce is (excerpts from the book):

Model

db.define_table('person',
Field('name','string'),
Field('surname','string'),
Field('image_filename'),
Field('image', 'upload'))

db.define_table('dog',
Field('owner', db.person),
Field('name', requires=IS_NOT_EMPTY()))

Controller

def display_form():
record = db.person(request.args(0))
url = URL('download')
link = URL('list_records')
form = SQLFORM(db.person, record, deletable=True, upload=url,
linkto=link)
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
   response.flash = 'form has errors'
return dict(form=form)

def download():
return response.download(request, db)

def list_records():
table = request.args(0)
query = request.vars.query
records = db(query).select(db[table])
return dict(records=records,table=table,query=query)

Views

display_form.html

{{extend 'layout.html'}}
Display Form
{{=form}}

list_records.html

{{extend 'layout.html'}}
Tabla: {{=table}}
Query: {{=query}}
{{=records}}

Obviously this happens because the query is not a Query object but
then the example in the book is wrong.



[web2py] Re: ticket with book example under 7.2.6 Links to Referencing Records

2012-01-28 Thread Anthony
Have you tried it with the latest trunk?

On Saturday, January 28, 2012 10:27:45 PM UTC-5, DenesL wrote:
>
> As reported in the Spanish group, the example under section 7.2.6 
> Links to Referencing Records, calling the list_records action with a 
> query var, e.g.: 
>
> http://127.0.0.1:8000/test/test/list_records/person?query=person.id>0 
>
>
> Traceback (most recent call last): 
>   File "C:\w2p\web2py_1.99.4_src\gluon\restricted.py", line 204, in 
> restricted 
> exec ccode in environment 
>   File "C:/w2p/web2py_1.99.4_src/applications/test/controllers/ 
> test.py", line 34, in  
>   File "C:\w2p\web2py_1.99.4_src\gluon\globals.py", line 172, in 
>  
> self._caller = lambda f: f() 
>   File "C:/w2p/web2py_1.99.4_src/applications/test/controllers/ 
> test.py", line 30, in list_records 
> records = db(query).select(db[table]) 
>   File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 6333, in select 
> return self.db._adapter.select(self.query,fields,attributes) 
>   File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1274, in select 
> sql = self._select(query, fields, attributes) 
>   File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1672, in _select 
> sql = super(SQLiteAdapter, self)._select(query, fields, 
> attributes) 
>   File "C:\w2p\web2py_1.99.4_src\gluon\dal.py", line 1155, in _select 
> if query and not query.ignore_common_filters: 
> AttributeError: 'str' object has no attribute 'ignore_common_filters' 
>
> The code to reproduce is (excerpts from the book): 
>
> Model 
>
> db.define_table('person', 
> Field('name','string'), 
> Field('surname','string'), 
> Field('image_filename'), 
> Field('image', 'upload')) 
>
> db.define_table('dog', 
> Field('owner', db.person), 
> Field('name', requires=IS_NOT_EMPTY())) 
>
> Controller 
>
> def display_form(): 
> record = db.person(request.args(0)) 
> url = URL('download') 
> link = URL('list_records') 
> form = SQLFORM(db.person, record, deletable=True, upload=url, 
> linkto=link) 
> if form.process().accepted: 
> response.flash = 'form accepted' 
> elif form.errors: 
>response.flash = 'form has errors' 
> return dict(form=form) 
>
> def download(): 
> return response.download(request, db) 
>
> def list_records(): 
> table = request.args(0) 
> query = request.vars.query 
> records = db(query).select(db[table]) 
> return dict(records=records,table=table,query=query) 
>
> Views 
>
> display_form.html 
>
> {{extend 'layout.html'}} 
> Display Form 
> {{=form}} 
>
> list_records.html 
>
> {{extend 'layout.html'}} 
> Tabla: {{=table}} 
> Query: {{=query}} 
> {{=records}} 
>
> Obviously this happens because the query is not a Query object but 
> then the example in the book is wrong. 
>
>

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-28 Thread Magnitus
Ah, obviously, the default server is Rocket, not Tornado (sorry for the 
typo, I guess Tornado just sounds cooler :P).

Anyways, I guess I'll test it on my web2py+Apache node next time I do an 
update on it in order to isolate the server variable.


[web2py] 'Morsel' object has no attribute 'split' ?

2012-01-28 Thread Ben Tammetta
Hello,

I am using the code provided here to create a web2py facebook application 
https://github.com/pythonforfacebook/facebook-sdk/blob/master/facebook.py

When I call this function inside of facebook.py .
testvar = facebook.get_user_from_cookie(request.cookies, FACEBOOK_APP_ID, 
FACEBOOK_APP_SECRET)

I always get this error.
'Morsel' object has no attribute 'split' 

It is trying to split the signed_request variable that does exits as in 
this case which was returned from facebook.

signed_request 
signed_request.split undefined

I am not sure what I am doing wrong.  Any pointers or suggestions?

Ben

More details below.


Ticket ID

127.0.0.1.2012-01-29.00-45-53.cca4dcc3-0338-40d3-aaf0-e9ec6a29f163
 'Morsel' object has no attribute 'split'
Version
web2py™ (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable')
Python Python 2.6.6: /usr/bin/python



Traceback
File "applications/FB_Tab_App/modules/facebook.py", line 376, in 
get_user_from_cookie
parsed_request = parse_signed_request(cookie, app_secret)
File "applications/FB_Tab_App/modules/facebook.py", line 395, in 
parse_signed_request
l = signed_request.split('.', 2)
AttributeError: 'Morsel' object has no attribute 'split'

Error snapshot help

('Morsel' object has no attribute 'split')

..

Function argument list

(signed_request=,
 
app_secret='16dc8c9503dca01b0bf3b36a41e4b43c')

.

Code listing


information requested in the scope.

If the signed_request is malformed or corrupted, False is returned.
"""
try:
l = signed_request.split('.', 2)

encoded_sig = str(l[0])
payload = str(l[1])
sig = base64.urlsafe_b64decode(encoded_sig + "=" * ((4 - len(encoded_sig) % 
4) % 4))
data = base64.urlsafe_b64decode(payload + "=" * ((4 - len(payload) % 4) % 
4))

Variables
signed_request 
signed_request.split undefined
l undefined