Created
September 21, 2012 15:06
-
-
Save garrypolley/3762045 to your computer and use it in GitHub Desktop.
Revisions
-
garrypolley created this gist
Sep 21, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # -*- coding: utf-8 -*- from django.conf.urls import include def decorated_include(urls, decorator) """Used to decorate all urls in a 3rd party app with a specific decorator""" urls_to_decorate = include(urls) for url_pattern in urls_to_decorate url_pattern._callback = decorator(url_pattern._callback) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # -*- coding: utf-8 -*- from django.conf.urls import patterns, include, url from django.contrib.auth.decorators import login_required from .decorators import decorated_include urlpatterns = patterns('', url(r'^admin/', decorated_include('mongoanut.urls', login_required), url(r'^auth/', include('social_auth.urls')), )