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!