I want to load a particular view depending on the url, for example:
url(r'^channel/(?P<channel>\d+)/$', ---, name='channel_render'),
Depending on the channel passed into the url, I want to load a specific view file. I tried doing this:
def configure_view(channel):
print channel
urlpatterns = patterns('',
url(r'^channel/(?P<channel>\d+)/$', configure_view(channel), name='channel_render'),
But obviously the channel argument is not getting passed in. Is there any way to do this? The only other solution I can think of is loading a manager view and then loading the relevant view file from there. If this is the only way, how do I redirect to another view file from within a view?