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:
Cristi Vîjdea
2018-01-12 03:37:04 +01:00
committed by GitHub
parent 757d47e1c0
commit 7a3fe8ec0c
13 changed files with 247 additions and 99 deletions
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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'))),
]