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?