예제 #1
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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 import settings
from django.conf.urls import url, include
from django.urls import path, re_path
from django.conf.urls.static import static

from backend.views import IndexView
import authe.urls
import api.urls

urlpatterns = [
    url('', include(authe.urls)),
    url(r'^api/', include(api.urls), name='api'),
    url(r'^(?!admin|api|static).*$', IndexView.as_view())
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if settings.DEBUG:
    urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
예제 #2
0
from rest_framework_jwt.views import obtain_jwt_token, verify_jwt_token
from apps.auth_api import views

router = DefaultRouter()
# router.register('posts', views.PostViewSet)
router.register('pages', views.PageViewSet)
router.register('users', views.UserViewSet)
router.register('tags', views.TagViewSet)
router.register('category', views.CategoryViewSet)

urlpatterns = []

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

    urlpatterns.append(
        url(r'^media/(?P<path>.*)$', django.views.static.serve,
            {'document_root': settings.MEDIA_ROOT}))

urlpatterns += [
    url(r'^admin/', admin.site.urls),
    url(r'^api-auth/', obtain_jwt_token),
    url(r'^api-auth-verify/', verify_jwt_token),
    url(r'^sign-up/', views.RegisterView.as_view()),
    url(r'^api/', include(router.urls)),

    # Vue on frontend
    url(r'^', IndexView.as_view()),
]
예제 #3
0
파일: urls.py 프로젝트: mlewis/react-ml
from django.conf.urls import include, url
from django.contrib import admin

from rest_framework.routers import DefaultRouter
from backend.views import PostViewSet, IndexView

router = DefaultRouter()
router.register(r'posts', PostViewSet)


urlpatterns = [
    # Examples:
    # url(r'^$', 'reactml.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),

    url(r'^admin/', include(admin.site.urls)),

    url(r'^$', IndexView.as_view()),
]
예제 #4
0
"""mikelewis 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'))
"""
from django.conf.urls import url, include
from django.contrib import admin

from backend.views import IndexView, PostView, TagView

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

    url(r'^tag/(?P<slug>[-\w]+)/$', TagView.as_view(), name='tag'),
    url(r'^post/(?P<slug>[-\w]+)/$', PostView.as_view(), name='post-detail'),
    url(r'^$', IndexView.as_view(), name='home')
]
예제 #5
0
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path

from backend.views import IndexView, BasicSettingsView, UserManageView, StaffManageView, RoleManageView, \
    MessageManageView, GoodsListView, EnterpriseListView, OrderListView, EshopDecorationView, ExcelExportView, \
    ExcelImportView

app_name = "backend"

urlpatterns = [
    path('index/', IndexView.as_view(), name='index'),
    path('basic_settings/', BasicSettingsView.as_view(),
         name='basic_settings'),
    path('user_manage/', UserManageView.as_view(), name='user_manage'),
    path('staff_manage/', StaffManageView.as_view(), name='staff_manage'),
    path('role_manage/', RoleManageView.as_view(), name='role_manage'),
    path('message_manage/', MessageManageView.as_view(),
         name='message_manage'),
    path('goods_list/', GoodsListView.as_view(), name='goods_list'),
    path('enterprise_list/',
         EnterpriseListView.as_view(),
         name='enterprise_list'),
    path('order_list/', OrderListView.as_view(), name='order_list'),
    path('eshop_decoration/',
         EshopDecorationView.as_view(),
         name='eshop_decoration'),