Django class based view URL API I kind of started making an API for my site in a Django class based view because it seemed logical and now it has gotten quite large and unruly and I am starting to wonder if I am doing this correctly.

class URLAPI(View):

    def get(self, request):

         if request.GET.get('param') == "foo":
             ...

         elif request.GET.get('param') == "bar":
             ...

         elif request.GET.get('param') == "foo" and request.GET.get('param2') == "arg":
             ...


I did the same thing with the post function creating conditionals for the data that is coming in. What do you think about this?
If you are going to have a lot of cases, and each one is quite complex (more than a few lines) I would ditch the if/elif approach.

Instead I would have inner functions, one for each case. Then a dictionary will map each case ('foo', 'bar' etc) to its function.

For example:

class URLAPI(View):
    def get(self, request):
        def act_on_foo():
            ...
        def act_on_bar():
            ...

        func_dict = {'foo': act_on_foo,
                     'bar': act_on_bar}

        param = request.GET.get('param')
        func_dict[param]()


Perhaps an even better design would be to move the act_on_foo and act_on_bar functions to another module to decouple the view from the logic behind it.


And some nitpicking: 
Try to avoid mixing " and ' in the same piece of code. Pick one and stick to it.