from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from openwisp_users.api.urls import get_api_urls urlpatterns = [] if os.environ.get('SAMPLE_APP', False): from openwisp_network_topology.utils import get_visualizer_urls from .sample_network_topology.visualizer import views urlpatterns += [ url(r'^topology/', include(get_visualizer_urls(views))), ] urlpatterns += [ url(r'^', include('openwisp_network_topology.urls')), url(r'^admin/', admin.site.urls), url(r'^api/v1/', include('openwisp_utils.api.urls')), url(r'^api/v1/', include(get_api_urls())), ] urlpatterns += staticfiles_urlpatterns() if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS: import debug_toolbar urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import include, path from openwisp_users.api.urls import get_api_urls urlpatterns = [] if os.environ.get('SAMPLE_APP', False): from openwisp_network_topology.utils import get_visualizer_urls from .sample_network_topology.visualizer import views urlpatterns += [path('topology/', include(get_visualizer_urls(views)))] urlpatterns += [ path('', include('openwisp_network_topology.urls')), # needed to test integrations path('', include('openwisp_controller.urls')), path('admin/', admin.site.urls), path('api/v1/', include('openwisp_utils.api.urls')), path('api/v1/', include(get_api_urls())), ] urlpatterns += staticfiles_urlpatterns() if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS: import debug_toolbar urlpatterns += [path('__debug__/', include(debug_toolbar.urls))]
import os from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import include, path from openwisp_users.api.urls import get_api_urls if os.environ.get('SAMPLE_APP', False): # We don't need to set any value for api_views # if we don't want to extend the views (optional). api_views = None else: # If we want to extend the views, we call these views from .sample_users import views as api_views urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('openwisp_users.accounts.urls')), path('api/v1/', include((get_api_urls(api_views), 'users'), namespace='users')), path('api/v1/', include('openwisp_utils.api.urls')), # Only for testing 'testapp' path('testing/', include('testapp.urls')), ] urlpatterns += staticfiles_urlpatterns()
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import reverse_lazy from django.views.generic import RedirectView from openwisp_users.api.urls import get_api_urls redirect_view = RedirectView.as_view(url=reverse_lazy('admin:index')) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include('openwisp_controller.urls')), url(r'^$', redirect_view, name='index'), url(r'^firmware/', include('openwisp_firmware_upgrader.private_storage.urls')), url(r'^api/v1/', include('openwisp_utils.api.urls')), url(r'^api/v1/', include((get_api_urls(), 'users'), namespace='users')), url(r'^api/v1/', include('openwisp_firmware_upgrader.api.urls')), ] urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS: import debug_toolbar urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))