Missing signed_request Error with Facebook App in pythonanywhere - facebook-apps

I've got an app through python anywhere that runs on facebook. The app runs fine, but with a catch. The first time I use it each day by going to the app (through facebook), it displays "400 Bad Request missing signed_request." When I click the pythonanywhere link "You can see your we app at http://username.pythonanywhere.com/ it gives me the same error as well.
I can temporarily fix the app by reloading my web files, however the error occurs the next day again, and reloading the web files does not fix the username.pythonanywhere error.
Is there anyway to fix this? If not, is there any way to get pythonanywhere to reload the web files automatically?
Thank you!
My code is below:
views.py:
from django.shortcuts import render
from django_facebook.decorators import canvas_only
#canvas_only
def home(request):
access_token = request.facebook.graph.access_token
return render(request,'home.html',{'access_token':access_token})
urls.py:
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('',
url(r'^$', 'snake.myapp.views.home', name="home"),
)
templates/home.py
<html>
<body>
<p>ACCESS TOKEN INSTRUCTIONS:</p>
<p>Copy the entire line below (it goes far to the right) into SNAKE-F and click "Get new token"</p>
<p>{{access_token}}</p>
</body>
</html>
The app is only supposed to show a short message and an access token, it's still being built at the moment so nothing else should appear. Again, thank you very much for the help!

I think you send this session on canvas not to the website and this will show you :Missing signed_request." error.

Related

can't save changes when deleting Routing App Coverage File

I'm trying to remove the Routing App Coverage .geojson file. Every-time I try to remove this and save changes, I get this error:
We’re temporarily unable to save your changes. Please try again
later.
It's been 2 days now. I still can't remove it. If I try to change any other field in the app submission form, it works. Just not the Routing file.
Here is what happened that led to this point:
I tried to submit an app with a valid .geojson file
I got an Invalid Binary error and the app was not submitted. This is because my app does not support routing.
I try to remove the Routing .geojson file from my submission form.
It doesn't work. I keep getting the error " We’re temporarily unable to save your changes. Please try again later. "
Error keeps occurring after 2 days.
I have no idea what is wrong. Please help. Thanks
I do not know if you have solved this, but I had the same problem. Just inspect the element (that pop-up that appears on top of the Routing App coverage), delete the element from browser's tree and press the delete button.

Javascript split working incorrectly in IE

I have one page checkout. My OPC works fine with other browsers but I get a fatal error with IE. IE's Javascript console says Object doesn't support this property or method.. The method in question is var items = field_name.split(reg) from the file: order-address.tpl.
I have no idea what is causing the problem. Because of this error, I cannot login properly from one page checkout when using IE. It seems that there are a lot of people with the same problem. What's the issue?
This error is present in 1.4.9, 1.4.10, and 1.5.3.
SOLVED. It turns out the issue is not with coding but with settings of IE.
All I had to do was reset IE from Tools => internet options => advanced => reset (including personal settings)
That did it for me. Thank you altafhussain for trying to help me out.

ReportViewer cannot shown in Firefox8 and Chrome15

I have an asp.net mvc3 project, it has some reports in aspx web pages. Everything works great in 2-3 weeks ago, but now, when I open the reports pages in FireFox8 and Chrome 15, the reports can not be displayed correctly.
In FF8, report content can be shown, but looks like css doesn't loaded, and report head control look like this:
In Chrome15, report head looks fine but content isn't shown up. I can see it has correct contents when using Firebug to view those .
Since data can ben loaded to browser, I think it maybe a browser compatibility problem, am I right?
Does anyone seeing same issues? I'm open to any suggestions.
BTW:My report viewer's version is 10.0.0.0.
Thanks.
[Edit in 12/21/2011]
FireFox
After several research on this, I have noticed when browse in firefox, server will catch an [Microsoft.Reporting.WebForms.HttpHandlerInputException: Missing URL parameter: Name], and the query string is OpType=BackImage&Version=10.0.40219.329&Color=%23ECE9D8&Name=Microsoft.Reporting.WebForms.Icons.toolbar_bk.png; path_info is Reserved.ReportViewerWebControl.axd
This may be the reason why firefox can't show page with correct CSS.
I don't know why this happens in Firefox & Chrome, while in IE everything is fine.
I've found this link shows same excpetion: http://social.msdn.microsoft.com/Forums/eu/vsreportcontrols/thread/80ce3ee8-e65b-476c-b668-ecc8e83ea73d
But I'm not sure how did he solve this, can you or somebody else gives some tip or example code to solve this?
Chrome
When browse in chrome, I found the report data is loaded into DOM, and surronded by a with id="ReportViewer1_fixedTable". Inside that element, there's a div with id="ReportViewer1_ctl09" nested in , if I remove the "height: 100%", the report can be seen.
this link http://www.apptools.com/examples/tableheight.php, explained why this 100% cannot be rendered correctly, but I'm still failed when trying to give a fixed height via CSS, the code can't be pasted here, please see this as a reference.
Thanks.
In Chrome, it's the "height=100%" problem.
Once I add following jQuery code, the report area can ben shown.
$(function () {
$("#ReportViewer1_ctl09").css("height", "auto");
});
In FireFox, the report page raise an error as following:
"Microsoft.Reporting.WebForms.HttpHandlerInputException 缺少 URL 参数: Name"
and the Query String is: "OpType=BackImage&Version=10.0.40219.329&Color=%23ECE9D8&Name=Microsoft.Reporting.WebForms.Icons.toolbar_bk.png"
according to this article, I think it's caused by a proxy that handles http request..
I checked my request, there's a "FiftyOne ..." in "Brwoser" property of "Request" ojbect.
Since fifty one is no longer used in this project, I removed it from Bin and web config, then the report can be shown in FireFox!
Hope this article can be usefule to other guys.

Permission denied error in all.js

I am using all.js for facebook implementation. I used a facebook button on signup page . by logging through facebook i am getting user name and email of facebook user into the fields on sign up page.
It's working fine on Chrome, Safari and Firefox but its giving error on IE8.
the error is in all.js line 22
{FB.UIServer._loadedNodes[a.id]=b;if(a.params)b.fbCallID=a.id;
Please help me if any one knows why this problem is occuring .
Thanks
Udham
Try this out. It worked for me, may help some one.
FB.UIServer.setLoadedNode = function (a, b){FB.UIServer._loadedNodes[a.id] = b; }
Ideally attach debugger and see which method breaks up and hack it.
This is a known bug: http://bugs.developers.facebook.net/show_bug.cgi?id=19042
It is set as CLOSED FIXED, but many users are still reporting the error in the comments area.
A hack is suggested on comment #19:
FB.init({
....
....
});
FB.UIServer.setActiveNode = function(a,b){FB.UIServer._active[a.id]=b;} // IE hack to correct FB bug
It worked for some people. I must say it didn't work for me, but I thought it was worth to mention.
I just ran into this (or a similar problem). Mine was in all.js line 22, char 3160, right after document.documentElement.style.display='none'; It was a permission denied error.
In my case, it was because the channelUrl was using a different protocol (https) than my app's iframe was being loaded under (http). I tried //mydomain.com/channel.html, but that gave me a different error. I solved it by dynamically choosing http/https for channelUrl when generating the html.
I found a solution. Already posted an answer here https://stackoverflow.com/a/8504794/287604, but for the desperate the quick fix:
FB.init({
appId: 'xxxxx',
appSecret: 'xxxxxxxxx',
status: true
cookie: true
});
// this code solves the issue
FB.UIServer.setLoadedNode = function (a, b) {
FB.UIServer._loadedNodes[a.id] = b;
};
I am still struggling with this but an odd work around I just noticed is if when using fb:login-button when setting the show-faces attribute to "true" it suddenly works fine. I tried 2 side by side fb:login buttons and the button with show faces set to either false or not included would pass back the error every time.

Secured and unsecured items message in IE

I'm getting "This page contains bothe Secure and Non secure items"message in IE. When I commented the following piece of code from dojo.js.uncompressed.js file, the message is gone.
if(dojo.isIE){
if(!dojo.config.afterOnLoad){
document.write('<scr'+'ipt defer src="//:" '
+ 'onreadystatechange="if(this.readyState==\'complete\'){' + dojo._scopeName + '._loadInit();}">'
+ '</scr'+'ipt>'
);
}
Is that an issue with the dojo? I would like to move the commented code to another custom file so that the dojo framework is not affected. Can you suggest a better way of implementing it.
Thanks.
You would get that error if you're using frames or have external files where some of the files have https URLs while some have http URLs. Assuming, your main page loads up through https, you could try changing:
src="//:"
to:
src="https//:"
the //: is most likely the problem, as I ran into a similar issue with a chunk of javascript code... In internet explorer, the locaiton //: is not secure, so when your page (presumably on an https:// url) loads, IE notes that you've got your main code loading from a secure location, and another script being loaded in from an unsecure location.
The workaround that I came to was to create an empty file in my web root named "blank.html" (though "blank.js" would probably work better in your case) and replace the //: link with "/blank.html". This results in another hit to your webserver, but browser caching will probably make that impact minimal.