Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FacebookWSGIMiddleware doesn't work in Pylons v1.0 #52

Open
a13x opened this issue Jun 21, 2010 · 0 comments
Open

FacebookWSGIMiddleware doesn't work in Pylons v1.0 #52

a13x opened this issue Jun 21, 2010 · 0 comments

Comments

@a13x
Copy link

a13x commented Jun 21, 2010

Configuring pyfacebook with pylons doesn't work as following import of redirect_to silently fails:
from pylons.controllers.util import redirect_to as pylons_redirect_to

Under Pylons v1.0 there's no redirect_to (it has been changed to redirect)

Here's the diff to fix the problem:
diff --git a/facebook/wsgi.py b/facebook/wsgi.py
index f6a790d..ea49e76 100644
--- a/facebook/wsgi.py
+++ b/facebook/wsgi.py
@@ -82,7 +82,7 @@ class FacebookWSGIMiddleware(object):

try:
import pylons

  • from pylons.controllers.util import redirect_to as pylons_redirect_to
  • from pylons.controllers.util import redirect as pylons_redirect
    from routes import url_for
    except ImportError:
    pass
    @@ -112,7 +112,7 @@ else:
    """
    if self.in_canvas:
    raise CanvasRedirect(url)
  •        pylons_redirect_to(url)
    
  •        pylons_redirect(url)
    
     def apps_url_for(self, *args, **kargs):
         """Like url_for, but starts with "http://apps.facebook.com"."""
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant