I think your intention will be clearer if you do this in two URLs:
url(r'^(api|internal|admin)/', SomeView.as_view()),
url(r'^.*', MainView.as_view())
MainView will only be executed if the URL does not start with api, internal or admin.
SomeView , URL- api/internal/admin, . 404 .
:
/api/users include(api_patterns)/api/foo SomeView/foo MainView
Edit
: url , , . ( , ):
d = OrderedDict([
(r'api', api_patterns),
(r'internal', internal_patterns),
(r'admin', admin.site.urls),
])
main_view_re = r'^!({})/'.format('|'.join(d.keys()))
urlpatterns = [url(r'^{}/'.format(k), include(v)) for k, v in d]
urlpatterns.append(url(main_view_re, MainView.as_view()))