be able to disable a given API version

Change-Id: I1827e853b34c05ff3753636a6c4968d86c3f565f
This commit is contained in:
Adrian Turjak 2017-09-15 12:02:57 +12:00
parent 3973fcb446
commit b0ce4a1167
1 changed files with 8 additions and 3 deletions

View File

@ -12,14 +12,19 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.apps import apps
from django.conf.urls import url, include
from django.conf import settings
from rest_framework_swagger.views import get_swagger_view
urlpatterns = [
url(r'^v1/', include('adjutant.api.v1.urls')),
]
urlpatterns = []
# NOTE(adriant): This may not be the best approach, but it does work. Will
# gladly accept a cleaner alternative if it presents itself.
if apps.is_installed('adjutant.api.v1'):
urlpatterns.append(url(r'^v1/', include('adjutant.api.v1.urls')))
if settings.DEBUG:
schema_view = get_swagger_view(title='Adjutant API')