daily pastebin goal
55%
SHARE
TWEET

Include Urls Decorated

garrypolleygmail Sep 21st, 2012 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2.  
  3. from django.conf.urls import patterns, include, url
  4. from django.contrib.auth.decorators import login_required
  5.  
  6. from .views import LogoutView
  7.  
  8. # Put auth around monognaut urls
  9. mongonaut_urls = include('mongonaut.urls')
  10. for url_pattern in mongonaut_urls[0].urlpatterns:
  11.     url_pattern._callback = login_required(url_pattern._callback, login_url="/auth/login/twitter")
  12.  
  13. urlpatterns = patterns('',
  14.     url(r'^admin/', mongonaut_urls),
  15.     url(r'^auth/', include('social_auth.urls')),
  16.     url(r'^auth/logout', LogoutView.as_view(), name='logout'),
  17.     url(r'', include('whiskerboard.urls')),
  18. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top