Improve host, schemes and basePath handling (#42)
* added handling of basePath by taking into account SCRIPT_NAME and the longest common prefix * improved handling of NamespaceVersioning by excluding URLs of differing versions * added documentation and error messages for the problem reported in #37
This commit is contained in:
@@ -17,7 +17,7 @@ class SnippetListV2(SnippetListV1):
|
||||
serializer_class = SnippetSerializerV2
|
||||
|
||||
|
||||
app_name = 'test_ns_versioning'
|
||||
app_name = '2.0'
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", SnippetListV2.as_view())
|
||||
|
||||
@@ -19,7 +19,7 @@ schema_patterns = [
|
||||
|
||||
urlpatterns = [
|
||||
url(VERSION_PREFIX_NS + r"v1.0/snippets/", include(ns_version1, namespace='1.0')),
|
||||
url(VERSION_PREFIX_NS + r"v2.0/snippets/", include(ns_version2, namespace='2.0')),
|
||||
url(VERSION_PREFIX_NS + r"v2.0/snippets/", include(ns_version2)),
|
||||
url(VERSION_PREFIX_NS + r'v1.0/', include((schema_patterns, '1.0'))),
|
||||
url(VERSION_PREFIX_NS + r'v2.0/', include((schema_patterns, '2.0'))),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user