So basically i know i can call different functions based on urls from the urls.py in django.
Now what i want to know is, can i call the same function for two different urls:
urlpatterns = [ url(r'^v1/ttu/appliance/',views.get_appliances), url(r'^v1/ttu/appliance/(?P<appliance>[-.\w]+)$',views.get_appliances), ]
and my get_appliances in views.py is something like this:
def get_appliances(request, appliance): if appliance is None: #do something else: #do something else
is this possible?