Created
March 14, 2016 15:30
-
-
Save vccabral/859d6c6c0ba9cb58e108 to your computer and use it in GitHub Desktop.
redirect
This file contains 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 characters
from django.views.generic.base import RedirectView | |
class CustomRedirectView(RedirectView): | |
def get_redirect_url(self, *args, **kwargs): | |
return redirect("other/"+kwargs['extra_url']) | |
urlpatterns = patterns('', | |
... | |
url(r'^base/(?P<extra_url>.*)/$', CustomRedirectView.as_view(), name='redirect_view_name'), | |
url(r'^other/', include("otherapp.urls"), | |
.. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment