Пример #1
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/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'))
"""
from django.contrib import admin
from django.urls import path, include, re_path

from dashboard.views import LoginView, LogoutView, IndexView
from django.views.static import serve
#from opsweb.settings import STATIC_ROOT

urlpatterns = [
    path(r'admin/', admin.site.urls),
    #url(r'^static/(?P<path>.*)$', serve, {"document_root": STATIC_ROOT}),
    path('', IndexView.as_view(), name='index'),
    path('index/', IndexView.as_view(), name='index'),
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('dashboard/', include("dashboard.urls")),
    path('confd/', include('confd.urls')),
]
Пример #2
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/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'))
"""
from django.conf.urls import url, include
from django.contrib import admin

from dashboard.views import LoginView, LogoutView, IndexView
from django.views.static import serve
#from opsweb.settings import STATIC_ROOT

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    #url(r'^static/(?P<path>.*)$', serve, {"document_root": STATIC_ROOT}),
    url('^$', IndexView.as_view(), name='index'),
    url('^index/', IndexView.as_view(), name='index'),
    url('^login/', LoginView.as_view(), name='login'),
    url('^logout/', LogoutView.as_view(), name='logout'),
    url('^dashboard/', include("dashboard.urls", namespace="dashboard")),
    url('^confd/', include('confd.urls', namespace='confd')),
]
Пример #3
0
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

import views
from dashboard.views import DashboardView, ContactsView, CompaniesView, FunnelView, TasksView, TeamView, SettingsView, LogoutView

urlpatterns = [
	url(r'^$', DashboardView.as_view(), name='dash'),
	url(r'^contacts/$', ContactsView.as_view(), name='contacts'),
	url(r'^companies/$', CompaniesView.as_view(), name='companies'),
	url(r'^funnel/$', FunnelView.as_view(), name='funnel'),
	url(r'^tasks/$', TasksView.as_view(), name='tasks'),
	url(r'^team/$', TeamView.as_view(), name='team'),
	url(r'^settings/$', SettingsView.as_view(), name='settings'),
	url(r'^logout/$', LogoutView.as_view(), name='logout'),
]

if settings.DEBUG:
	urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
	urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)