I'm trying to create a url pattern that will behave like controller/action/id route in rails. So far here is what I have :
from django.conf.urls.defaults import *
import views
urlpatterns = ('',
(r'^(?P<app>\w+)/(?P<view>\w+)/$', views.select_view),
)
Here is my 'views.py':
def select_view(request, app, view):
return globals()['%s.%s', % (app, view,)]()
So far this hasn't worked. I get a key error exception in the 'globals' function. Am I going in the right direction here?