# place this snippet in your app's views.py file.
# it assumes your app is called 'account', so change below as needed

import sys
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
def route_request(request, path, urlparams):
  parameters = urlparams and urlparams[1:].split('/') or []
  funcname = 'process_request__%s' % path
  try:
    function = getattr(sys.modules[__name__], funcname)
  except AttributeError:
    return render_to_response('account/%s.dj' % path, { 'parameters': parameters })
  return function(request, parameters)