I want to perform check and allow access to only specific pattern URLs and exclude few.
Using the following check to match for the allowed URLs
ALLOWED_URL = [
'/auth/*'
]
and using fnmatch
to match the pattern
any(fnmatch(request.path, p) for p in settings.ALLOWED_URL)
This works for the following URL
/auth/login/
/auth/signup/google/
/auth/user-tracking/
But I want to exclude /auth/user-tracking/
from the URL and user should not access it. So I modified the pattern as
MULTI_USER_EXCLUDE_PATH = [
'/auth/[!user-tracking/*]*'
]
But this is now not working for
/auth/signup/google/