I'd suggest saying `if not STATIC_URL.endswith("/"):` -- it accomplishes the same thing, and it's more readable.