Exemplo n.º 1
0
    re_path(r'^api/swagger(?P<format>.json|.yaml)$',
            schema_view.without_ui(),
            name='schema_swagger'),

    # Serving static media in Django to pipe it through LoginRequiredMiddleware
    path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}),

    # Admin
    path('admin/', admin_site.urls),
    path('admin/background-tasks/', include('django_rq.urls')),
    # TODO: Remove in v2.9
    path('admin/webhook-backend-status/', RQRedirectView.as_view()),

    # Errors
    path('media-failure/',
         StaticMediaFailureView.as_view(),
         name='media_failure'),

    # Plugins
    path('plugins/', include((plugin_patterns, 'plugins'))),
    path('api/plugins/', include((plugin_api_patterns, 'plugins-api'))),
    path('admin/plugins/', include(plugin_admin_patterns))
]

if settings.DEBUG:
    import debug_toolbar
    _patterns += [
        path('__debug__/', include(debug_toolbar.urls)),
    ]

if settings.METRICS_ENABLED:
Exemplo n.º 2
0
    path('api/ipam/', include('ipam.api.urls')),
    path('api/tenancy/', include('tenancy.api.urls')),
    path('api/users/', include('users.api.urls')),
    path('api/virtualization/', include('virtualization.api.urls')),
    path('api/wireless/', include('wireless.api.urls')),
    path('api/status/', StatusView.as_view(), name='api-status'),
    path('api/docs/', schema_view.with_ui('swagger', cache_timeout=86400), name='api_docs'),
    path('api/redoc/', schema_view.with_ui('redoc', cache_timeout=86400), name='api_redocs'),
    re_path(r'^api/swagger(?P<format>.json|.yaml)$', schema_view.without_ui(cache_timeout=86400), name='schema_swagger'),

    # GraphQL
    path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql'),

    # Serving static media in Django to pipe it through LoginRequiredMiddleware
    path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}),
    path('media-failure/', StaticMediaFailureView.as_view(), name='media_failure'),

    # Plugins
    path('plugins/', include((plugin_patterns, 'plugins'))),
    path('api/plugins/', include((plugin_api_patterns, 'plugins-api'))),

    # Admin
    path('admin/background-tasks/', include('django_rq.urls')),
    path('admin/plugins/', include(plugin_admin_patterns)),
    path('admin/', admin_site.urls),
]


if settings.DEBUG:
    import debug_toolbar
    _patterns += [