2012-09-03 43 views
2

我正在使用以下設置首先對用戶進行身份驗證,然後使用身份驗證信息來處理以下請求。指定的URL不屬於應用程序

從views.py

@canvas_only 
def authenticate(request): 
    request.session['access_token'] = request.facebook.graph.access_token 
    return render(request, 'authenticated.html', {}) 

class Home(View): 

    def get(self, request, *args, **kwargs): 
     """The home to be called from within the application""" 

     access_token = request.session['access_token'] 
     graph = facebook.GraphAPI(access_token) 
     me = graph.get_object('me') 
     request.session['my_id'] = me['id'] 
     template_data = _collect_home_data(graph) 

     return render(request, 'home.html', template_data) 

從urls.py:

urlpatterns = patterns('', 
    url(r'^$', 'crosswords.ugly.views.authenticate'), 
    url(r'^home/$', Home.as_view(), name='home'), 

這主要工作(即現在的應用程序工作正常中的鏈接),但新用戶(誰沒有授權的應用程序)得到以下錯誤信息:

Crossword發生錯誤。請稍後再試。

API Error Code: 191 
API Error Description: The specified URL is not owned by the application 
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration. 

在Facebook上的應用程序設置(帆布網址,安全的帆布網址)都指向

HTTP(S)://finebitstrings.pythonanywhere.com/

能有什麼我確實要擺脫那個錯誤?

+0

可能的重複[錯誤191在Facebook上,但URL設置正確](http://stackoverflow.com/questions/12249930/error-191-on-facebook-but-url-is-set-up-正確) – Raptor

回答

相關問題