urls.py 2.22 KB
"""pyros URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""


# Django imports
from django.contrib import admin
from django.conf import settings
from django.urls import include, path  # For django versions from 2.0 and up
from django.conf.urls.static import static

# Project imports
import dashboard

'''
urlpatterns = [
    url(r'^admin/', admin.site.urls),
]
'''
urlpatterns = [

    path('admin/', admin.site.urls),

    path('user_mgmt/', include('user_mgmt.urls')),
    path('dashboard/', include('dashboard.urls')),

    path('devices/', include('devices.urls')),
    path('scheduling/', include('scheduling.urls')),
    path('alert_mgmt/', include('alert_mgmt.urls')),
    path('analyzer/', include('analyzer.urls')),
    path('majordome/', include('majordome.urls')),
    path('env_monitor/', include('env_monitor.urls')),
    path('observation_manager/', include('observation_manager.urls')),

    path('scp_mgmt/', include('scp_mgmt.urls')),
    path('seq_submit/', include('seq_submit.urls')),

    path('obs_config/', include('obs_config.urls')),
    path('api/', include('api.urls')),
    path('', dashboard.views.index)
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

#urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]

if settings.DEBUG:
    import debug_toolbar
    # urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))
    urlpatterns.append(
        path('__debug__/', include(debug_toolbar.urls))
    )

    '''
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls)),

        # For django versions before 2.0:
        # url(r'^__debug__/', include(debug_toolbar.urls)),

    ] + urlpatterns
    '''