You're using this to deduce that it was not a callable function. What if the `site_url()` function itself raises a `TypeError` then you're incorrectly swallowing that. 

I suggest you instead use `callable`. It was temporarily removed from python3 but they [changed their minds](http://docs.python.org/3/library/functions.html?highlight=callable#callable) so it's available in all python 2 and all modern python 3. I.e.

```
if callable(site_url):
    urls = site_url()
else:
    urls = site_url
```