Exemplo n.º 1
0
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include

from rest_framework import routers
from rest_framework.documentation import include_docs_urls

from posts.views import PostViewSet, CommitViewSet

router = routers.DefaultRouter()
router.trailing_slash = ''
router.register('posts', PostViewSet)
router.register('commits', CommitViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('docs/', include_docs_urls(title='django Post')),
    path('admin/', admin.site.urls),
]
Exemplo n.º 2
0
    url(r'^topics/', include('topics.urls', namespace = 'topics')),
    url(r'^chat/', include('chat.urls', namespace = 'chat')),
    url(r'^mural/', include('mural.urls', namespace = 'mural')),
    url(r'^webpages/', include('webpage.urls', namespace = 'webpages')),
    url(r'^ytvideo/', include('youtube_video.urls', namespace = 'youtube')),
    url(r'^file_links/', include('file_link.urls', namespace = 'file_links')),
    url(r'^goals/', include('goals.urls', namespace = 'goals')),
    url(r'^mailsender/', include('mailsender.urls', namespace = 'mailsender')),
    url(r'^security/', include('security.urls', namespace = 'security')),
    url(r'^themes/', include('themes.urls', namespace = 'themes')),
    url(r'^pendencies/', include('notifications.urls', namespace = 'notifications')),
    url(r'^links/', include('links.urls', namespace='links')),
    url(r'^pdf_files/', include('pdf_file.urls', namespace='pdf_files')),
    url(r'^questionary/', include('questionary.urls', namespace='questionary')),
    url(r'^webconferences/', include('webconference.urls', namespace = 'webconferences')),
    url(r'^news/', include('news.urls', namespace='news')),
    url(r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^analytics/', include('analytics.urls', namespace='analytics')),
    url(r'^dashboards/', include('dashboards.urls', namespace='dashboards')),
    url(r'^bulletin/', include('bulletin.urls', namespace='bulletin')),
    url(r'^questions_database/', include('banco_questoes.urls', namespace='questions_database')),
    url(r'^api-docs/', include_docs_urls(title = 'REST Api Documentation')),
    #API
    url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
    url(r'^summernote/', include('django_summernote.urls')),
    url(r'session_security/', include('session_security.urls')),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
Exemplo n.º 3
0
from django.urls import path

from .apiviews import PollViewSet, ChoiceList, CreateVote, UserCreate, LoginView

from rest_framework.routers import DefaultRouter

from rest_framework.documentation import include_docs_urls

from rest_framework_swagger.views import get_swagger_view

schema_view = get_swagger_view(title='Polls API')


router = DefaultRouter()
router.register('polls', PollViewSet, base_name='polls')


urlpatterns = [
    path("login/", LoginView.as_view(), name="login"),
    path("users/", UserCreate.as_view(), name="user_create"),
    path("polls/<int:pk>/choices/", ChoiceList.as_view(), name="polls_list"),
    path("polls/<int:pk>/choices/<int:choice_pk>/vote/", CreateVote.as_view(), name="polls_list"),
    path(r'docs/', include_docs_urls(title='Polls API')),
    path(r'swagger-docs/', schema_view),
]

urlpatterns += router.urls
Exemplo n.º 4
0
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.routers import DefaultRouter

from task.views import TaskListView, TaskViewSet
from rest_framework.authtoken import views

router = DefaultRouter()
router.register('tasks', TaskViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls')),
    path('docs/', include_docs_urls(title='Task API')),
    path('login/', views.obtain_auth_token),
    path('api/', include(router.urls)),
    path('task/', TaskListView.as_view())
]
Exemplo n.º 5
0
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from rest_framework.documentation import include_docs_urls
from rest_framework.schemas import get_schema_view

# API Version 2
from localities_healthsites_osm.api_views.osm.facilities.detail import (
    GetDetailFacility
)
from localities_healthsites_osm.api_views.osm.facilities.list import GetFacilities

api_osm = patterns(
    '',
    url(r'^docs/', include_docs_urls(title='Healthsites API OSM')),
    url(r'^schema/', get_schema_view(title='Healthsites API OSM')),
    url(r'^facilities/(?P<uuid>[\w\+%_& ]+)',
        GetDetailFacility.as_view(), name='api_osm_facility_detail'),
    url(r'^facilities',
        GetFacilities.as_view(), name='api_osm_facility_list'),
)
Exemplo n.º 6
0
    url(r'^login/$', views.login_view, name='login'),
    url(r'^delete_account/$', views.delete_account_view,
        name='delete_account'),
    url(r'^generate_key/$', views.generate_key_view, name='generate_key'),

# don't include without appropriate patching! admincdocs provides its own
# login view which can be used to bypass 2FA.
#   url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/logout/$', views.logout_view),
    url(r'^admin/', admin.site.urls),
]

urlpatterns += [
    url(r'^$', main_page_view, name='index'),
]

noncontest_patterns = []

if settings.USE_API:
    urlpatterns += [
        url(r'^api/token', api.api_token, name='api_token'),
        url(r'^api/regenerate_token', api.regenerate_token, name='api_regenerate_key'),
    ]
    noncontest_patterns += [
        # the c prefix doesn't make sense for non contest related endpoints as
        # well as for the documentation which anyway does not require authorization
        url(r'^api/docs/', include_docs_urls(title='OIOIOI API'), name='api_docs'),
        url(r'^api/ping', api.ping),
        url(r'^api/auth_ping', api.auth_ping),
    ]
Exemplo n.º 7
0
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. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""

from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin

api_urls = [
    url(r"^", include("apps.charlas.urls")),
    url(r'^', include('rest_framework.urls')),
]

if settings.DEBUG:
    from rest_framework.documentation import include_docs_urls
    api_urls += [url(r'^docs/', include_docs_urls(title='API Temii'))]



urlpatterns = [
    url(r'^api/', include(api_urls)),
    url(r'^admin/', include(admin.site.urls)),
]
Exemplo n.º 8
0
        views.UsersActivation.as_view(),
        name='users_activation',
    ),
    path(
        'profile',
        views.UserViewSet.as_view({'get': 'retrieve'}),
        name='profile',
        kwargs={'pk': 'me'},
    ),
    # Forgot password
    path('reset_password',
         views.ResetPassword.as_view(),
         name='reset_password'),
    path('change_password',
         views.ChangePassword.as_view(),
         name='change_password'),
    path('admin/', admin.site.urls),
    path(
        'docs/',
        include_docs_urls(
            title=settings.LOCAL_SETTINGS['ORGANIZATION'] + " API",
            authentication_classes=[],
            permission_classes=[])),
    path('api-auth/', include('rest_framework.urls')),
    path('', include(router.urls)),  # includes router generated URL
    # The retreat app must be namespaced due to conflicting resources names
    #   (reservations & pictures)
    path('retreat/',
         include((retirement_router.urls, 'retreat'), namespace='retreat')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 9
0
"""favorite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.permissions import AllowAny

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('api.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('api-docs/', include_docs_urls(title='Favorite API')),
]
Exemplo n.º 10
0
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 rest_framework.documentation import include_docs_urls

urlpatterns = [

    # Core
    url(r'^admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='Django REST')),

    # API
    url(r'^', include('messenger.urls', namespace="messenger")),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Exemplo n.º 11
0
router.register(r'v1/api/banners', BannerViewset, base_name="banners")
#首页商品系列数据
router.register(r'v1/api/indexgoods',
                IndexCategoryViewset,
                base_name="indexgoods")

# good_list = GoodsListViewSet.as_view({
#     'get': 'list',
#     'post': 'create'
# })

urlpatterns = [
    path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    path('ueditor/', include('DjangoUeditor.urls')),
    re_path(r'docs/', include_docs_urls(title="生鲜")),
    re_path(r'^api-auth/',
            include('rest_framework.urls', namespace='rest_framework')),
    # drf自带的token认证模式,弊端:token永久有效,并且会生成一张数据表存放token
    re_path(r'^api-token-auth/', views.obtain_auth_token),
    # jwt的认证接口
    re_path(r'^login/', obtain_jwt_token),

    # path('goods/', good_list, name='goods-list'),
    path('', include(router.urls)),
    #使用django代理
    path('index/',
         TemplateView.as_view(template_name='index.html'),
         name='index'),
    path('alipay/return/', AlipayView.as_view(), name='alipay'),
    re_path(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
Exemplo n.º 12
0
from django.contrib import admin
from django.urls import include, path
from rest_framework.documentation import include_docs_urls
urlpatterns = [
    path('', include(('generales.urls', 'generales'), namespace='generales')),
    path('inv/', include(('inv.urls', 'inv'), namespace='inv')),
    path('catalogos/',
         include(('catalogos.urls', 'catalogos'), namespace='catalogos')),
    path('salidas/', include(('salidas.urls', 'salidas'),
                             namespace='salidas')),
    path('plantas/', include(('plantas.urls', 'plantas'),
                             namespace='plantas')),
    path('tmuertos/',
         include(('tmuertos.urls', 'tmuertos'), namespace='tmuertos')),
    path('operaciones/',
         include(('operaciones.urls', 'operaciones'),
                 namespace='operaciones')),
    path('apis/', include(('apis.urls', 'apis'), namespace='apis')),
    path('admin/', admin.site.urls),
    path('coreapi-docs/',
         include_docs_urls(title='Documentacion CoreAPI MarBran')),
    path('admin/backups/', include('dbbackup_ui.urls')),
]
Exemplo n.º 13
0
# router = routers.DefaultRouter()
# router.register(r'users', views.UserViewSet)
# router.register(r'groups', views.GroupViewSet)

api_patterns = [
    # API URL List
    path(
        'api/',
        include([
            path('person_entity/v1/',
                 include('user.api.urls', namespace='persona_api')),
            path('item_entity/v1/',
                 include('product.api.urls', namespace='item_api')),
            path('order_entity/v1/',
                 include('order.api.urls', namespace='order_api')),
            path('docs/', include_docs_urls(title='ShopSite Apis')),
        ])),
    # path('api-auth', include('rest_framework.urls', namespace='rest_framework'))
]

translate_urlpatterns = i18n_patterns(
    # path('view/', include([
    path(_('user/'), include('user.urls', namespace='user_view')),
    path(_('item/'), include('product.urls', namespace='product_view')),
    path(_('cart/'), include('cart.urls', namespace='cart_view')),
    path(_('order/'), include('order.urls', namespace='order_view')),
    path(_('store/'), include('shop.urls', namespace='shop_view')),
    path(_('payment/'), include('payment.urls', namespace='payment_view')),
    path('rosetta/', include('rosetta.urls')),
    path('', IndexView.as_view(), name='index_view'),
    # ])),
Exemplo n.º 14
0
    path('login/', login_view, name='index'),
    path('info/', get_message, name='info'),
    path('person/', include('apps.user.urls')),
    path('logou/', logout_view, name='logou'),
    path('register/', Register.as_view(), name='register'),
    path('article/', include('apps.article.urls')),
    path('course/', include('apps.course.urls')),
    path('support/', include('apps.support.urls')),
    path('forum/', include('apps.forum.urls')),
    path('ads.txt/', TemplateView.as_view(template_name='ads.txt')),
    #url(r'^activate/(?P<token>\w+.[-_\w]*\w+.[-_\w]*\w+)/$', active_user, name='active_user'),
    path('activate/<str:token>', active_user, name='active_user'),
    url(r'^search/', include('haystack.urls'), name='haystack_search'),
    re_path(r'^upload/(?P<path>.*)$', serve,
            {'document_root': settings.MEDIA_ROOT}),
    url(r'api/', include(router.urls)),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    path("api-docs/", include_docs_urls("API文档")),
    re_path(r'api/login/$', obtain_jwt_token),  # jwt认证
    url('auth-qq', to_login, name='qq-login'),
    url('qq', qq, name='qq'),
    url('callbackget', getClback, name='callbackget'),
    url('getClbackQQ', getClbackQQ, name='getClbackQQ'),
    re_path(r'^static/(?P<path>.*)$', serve,
            {'document_root': settings.STATIC_ROOT})  # 配置文件上传html显示
]

#全局404
handler404 = 'apps.user.views.page_not_found'
handler500 = 'apps.user.views.page_error'
Exemplo n.º 15
0
    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.contrib import admin
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
from rest_framework_swagger.views import get_swagger_view
from rest_framework.documentation import include_docs_urls


urlpatterns = [
    url(r"", include("time_tracker.urls")),
    url(r"^admin/", admin.site.urls),
    url(r"^time-tracker/api/", include("time_tracker.urls")),
    url(r'^docs', include_docs_urls(title='MTR Time Tracker API')),
    url(r'^swagger$', get_swagger_view(title='MTR Time Tracker API')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if settings.DEBUG:
    import importlib
    deb_bar = importlib.util.find_spec("debug_toolbar")
    found = deb_bar is not None

    if found is True:
        import debug_toolbar
        urlpatterns += [
            url(r'^__debug__/', include(debug_toolbar.urls)),
        ]
Exemplo n.º 16
0
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.schemas import get_schema_view
from rest_framework_swagger.views import get_swagger_view

API_TITLE = "Blog API"
API_DESCRIPTION = "A Web API for creating and editing blog posts"

# schema_view = get_schema_view(title=API_TITLE)
schema_view = get_swagger_view(title=API_TITLE)

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/v1/", include("posts.urls")),
    path("api-auth/", include("rest_framework.urls")),
    path("api/v1/rest-auth/", include("rest_auth.urls")),
    path("api/v1/rest-auth/registration/",
         include("rest_auth.registration.urls")),
    path("docs/",
         include_docs_urls(title=API_TITLE, description=API_DESCRIPTION)),
    # path("schema/", schema_view),
    path("swagger-docs/", schema_view),
]
Exemplo n.º 17
0
Arquivo: urls.py Projeto: tadgh/KW
from contact_form.views import ContactFormView
from django.conf.urls import include, url

from django.contrib import admin
from django.views.generic import TemplateView, RedirectView
from django.contrib.auth import views as auth_views
from rest_framework.documentation import include_docs_urls

import kw_webapp
from KW import settings

admin.autodiscover()

urlpatterns = (
    url(r"^$", RedirectView.as_view(url="/docs/")),
    url(r"^docs/", include_docs_urls(title="Kaniwani Docs")),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^api/v1/", include("api.urls", namespace="api")),
)

if settings.DEBUG:
    import debug_toolbar

    urlpatterns += (url(r"^__debug__/", include(debug_toolbar.urls)),)
Exemplo n.º 18
0
# Cia
# UserCia
# UserLog
# Persona
# PersonaJuridica
# PersonaNatural
# Producto
# Direccion
# SesionTrabajo
# DocRep
# DocRepDet

urlpatterns = [
    url(r'^api-token-auth/', obtain_jwt_token),
    url(r'^admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='API Taller')),
    url(r'^', include(router.urls)),
    url(r'^selectraw/', selectraw),
    url(r'^reporte/', reporte),
    url(r'^convpdf/', convpdf),
    url(r'^estados-pdf/$',
        VistaPDF.as_view(template_name='estados-pdf.html'),
        name='estados-pdf'),
    # url(r'^my-pdf/$', VistaPDF.as_view(template_name='my-pdf.html'), name='my-pdf'),
    # url(r'^my-pdf/$', PDFView.as_view(template_name='my-pdf.html'), name='my-pdf'),
    # url(r'^my-pdf/$', PDFView.as_view(template_name='my-pdf.html',context='{'a':'1','b':'2'}'), name='my-pdf'),
    # url(r'^pdf/', generate_pdf),
    # url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
]

# from django.conf.urls.defaults import *
Exemplo n.º 19
0
    '',
    url(r'^facilities/count',
        GetFacilitiesCount.as_view(), name='api_v2_facility_count'),
    url(r'^facilities/shapefile/process/(?P<country_name>[\w\+%_& ]+)',
        GetFacilitiesShapefileProcess.as_view(), name='api_v2_facility_list'),
    url(r'^facilities/(?P<uuid>[\w\+%_& ]+)',
        GetDetailFacility.as_view(), name='api_v2_facility_detail'),
    url(r'^facilities/(?P<uuid>[\w\+%_& ]+)',
        GetDetailFacility.as_view(), name='api_v2_facility_detail'),
    url(r'^facilities',
        GetFacilities.as_view(), name='api_v2_facility_list'),
)

urlpatterns = patterns(
    '',
    url(r'^docs/', include_docs_urls(title='Healthsites API Version 2')),
    url(r'^schema/', SchemaView.as_view(), name='schema_view'),
    url(r'^v1/healthsites/facilities', FacilitiesApiView.as_view(), name='api_facilities'),
    url(
        r'^v1/healthsites/search', LocalitySearchApiView.as_view(), name='api_search_localities'
    ),
    url(
        r'^v1/healthsites/facility/details', LocalityDetailApiView.as_view(),
        name='api_locality_detail'
    ),
    url(
        r'^v1/healthsites/facility/synonyms', LocalitySynonymApiView.as_view(),
        name='api_locality_synonyms'
    ),
    url(
        r'^v1/healthsites/facility/add', LocalityCreateApiView.as_view(),
Exemplo n.º 20
0
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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'))
"""
# blog_project/urls.py
from django.contrib import admin
from django.urls import include, path
from rest_framework.documentation import include_docs_urls  # new
from rest_framework.schemas import get_schema_view

schema_view = get_schema_view(title='Blog API')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('posts.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('api/v1/rest-auth/', include('rest_auth.urls')),
    path('api/v1/rest-auth/registration/',
         include('rest_auth.registration.urls')),
    path('docs/', include_docs_urls(title='Blog API')),  # new
    path('schema/', schema_view),
]
Exemplo n.º 21
0
from server.routers import router, device_router
from catalog.routers import router as catalog_router
from stats.routers import router as stats_router

from django.contrib import admin
admin.autodiscover()

TITLE = 'Migasfree REST API'

swagger_schema_view = get_swagger_view(title=TITLE)

urlpatterns = [
    url(r'^', include('django.contrib.auth.urls')),
    url(r'^docs/', swagger_schema_view, name='docs'),
    url(r'^api-docs/', include_docs_urls(title=TITLE)),
    url(r'^token-auth/$', views.obtain_auth_token),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^api/v1/token/', include(router.urls)),
    url(r'^api/v1/token/', include(stats_router.urls)),
    url(r'^api/v1/token/devices/', include(device_router.urls)),
    url(r'^api/v1/token/catalog/', include(catalog_router.urls)),

    url(r'', include('migasfree.server.urls')),
    url(r'', include('migasfree.stats.urls')),

    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', admin.site.urls),

    url(r'^admin/lookups/', include(ajax_select_urls)),
    url(r'^markdownx/', include('markdownx.urls')),
Exemplo n.º 22
0
from rest_framework.schemas import get_schema_view
from apps.trade.views import AlipayView

schema_view = get_schema_view(title='图书商城API文档')
router = routers.DefaultRouter()

router.register(r"code", GetVerificationCode, base_name="code")
router.register(r"users", UserRegViewSet, base_name="user")
router.register(r"category", BookCategoryView, base_name="category")
router.register(r"goods", BookGoodsView, base_name="goods")
router.register(r"userfavs", UserCollectViewSet, base_name="userfavs")
router.register(r"address", AddressViewSet, base_name="address")
router.register(r"shopcarts", ShopCartView, base_name="shopcarts")
router.register(r"orders", OrderViewSet, base_name="orders")
router.register(r"banners", BannerView, base_name="banners")

urlpatterns = [
    url(r'', include('social_django.urls', namespace='social')),
    url(r'^', include(router.urls)),
    url(r'^schema/$', schema_view),
    url(r'^docs/', include_docs_urls(title="图书商城")),
    url(r'^admin/', admin.site.urls),
    # JWT
    url(r'^login/$', obtain_jwt_token),
    url(r'^(?P<path>.*)$', serve, {"document_root": settings.MEDIA_ROOT}),
    # TokenAuthentions
    url(r'^api-token-auth/', views.obtain_auth_token),
    url(r'^ueditor/', include(DjangoUeditor.urls)),
    url(r'^alipay/return/', AlipayView.as_view(), name="alipay"),
]
Exemplo n.º 23
0
# 商品
router.register(r'goods', GoodsListViewSet, base_name='goods')

# 商品分类
router.register(r'categorys', CategoryViewSet, base_name='categorys')

# 验证码
router.register(r'codes', SmsCodeViewset, base_name='codes')

# 注册
router.register(r'users', UserViewSet, base_name='users')

urlpatterns = [

    # 基础路由
    url(r'^admin/', xadmin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}),

    url(r'^', include(router.urls)),

    # 用户token
    url(r'^api-token-auth/', views.obtain_auth_token),

    # jwt认证模式
    url(r'^login/', obtain_jwt_token),

    # 文档
    url(r'docs/', include_docs_urls(title='天天生鲜'))
]
Exemplo n.º 24
0
"""pollsapi URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('polls.urls')),
    path(r'docs/', include_docs_urls(title='Polls API'))
]
Exemplo n.º 25
0
    url(r'ex$', views.gallery_exif_info_view, name="ajax_exif_root_view"),
    url(r'ex/(?P<obj_uuid>[\w-]+)$', views.gallery_exif_info_view, name="ajax_exif_detail_view"),

    # tag related views
    url(r'^t/u/$', views.tags_user_all, name="tags_user_all"),
    url(r'^t/u/(?P<tag>[\w.-|%| ]+)$', views.tags_user_detail, name="tags_user_detail"),
    url(r'^g/(?P<obj_uuid>[\w-]+)/t/$', views.tags_gallery_all, name="tags_gallery_all"),
    url(r'^g/(?P<obj_uuid>[\w-]+)/t/(?P<tag>[\w.-|%| ]+)$', views.tags_gallery_detail, name="tags_gallery_detail"),

    # other user pages
    url(r'^i/$', views.user_default_gallery_images, name="user_images"),
    url(r'^i/(?P<obj_uuid>[\w-]+)/settings/$', views.user_image_settings, name="user_image_settings"),

    # gallery views
    url(r'^g/$', views.user_galleries, name="user_galleries"),
    url(r'^g/mk/$', views.user_create_gallery, name="user_gallery_create"),
    url(r'^g/(?P<obj_uuid>[\w-]+)$', views.user_get_gallery_images, name="user_gallery_images"),
    url(r'^g/up/(?P<gallery_uuid>[\w-]+)$', views.upload, name="user_gallery_upload"),
    url(r'^g/(?P<obj_uuid>[\w-]+)/toggle_priv$', views.user_gallery_priv_toggle, name="user_gallery_privacy_toggle"),
    url(r'^g/(?P<obj_uuid>[\w-]+)/settings', views.user_gallery_settings, name="user_gallery_settings"),
    # galleryperma
    url(r'^g/p/(?P<obj_uuid>[\w-]+)/', views.linked_gallery_view, name="gallery_permalink"),

    # api
    url(r'^api/', include(router.urls, namespace='api')),
    #url(r'^api/(?P<version>(v1|v2))/', include(router.urls,namespace="apiversioned")),
    url(r'^api/docs/', include_docs_urls(title='API')),
]

#urlpatterns += [url(r'^api/(?P<version>(v1|v2))/', include('drf_openapi.urls'))]
Exemplo n.º 26
0
from rest_framework.authtoken import views
from rest_framework_jwt.views import obtain_jwt_token

router = DefaultRouter()

# 配置goods的url,这个basename是干啥的
router.register(r'goods', GoodsListViewSet, base_name="goods")

# 配置Category的url
router.register(r'categories', CategoryViewset, base_name="categories")


urlpatterns = [
    path('admin/', admin.site.urls),
    # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT
    re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT }),

    # 商品列表页
    # path('goods/', GoodsListView.as_view(),name="goods-list"),

    # router的path路径
    re_path('^', include(router.urls)),

    path('docs/', include_docs_urls(title='mtianyan超市文档')),
    path('api-auth/', include('rest_framework.urls')),


    # jwt的token认证
    path('login/', obtain_jwt_token),
]
Exemplo n.º 27
0
Arquivo: urls.py Projeto: ahernp/DMCM
from rest_framework import routers
from rest_framework.documentation import include_docs_urls

from django.urls import path, include

from .views import MarkdownToHtmlViewSet, PageViewSet

router = routers.SimpleRouter()
router.register("pages", PageViewSet)

urlpatterns = [
    path("docs/", include_docs_urls(title="DMCM")),
    path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
    path(
        "markdown-to-html",
        MarkdownToHtmlViewSet.as_view({"post": "update"}),
        name="markdown-to-html",
    ),
    path("", include(router.urls)),
]
Exemplo n.º 28
0
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.views.static import serve
from rest_framework import permissions
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
from rest_framework.documentation import include_docs_urls

API_TITLE = 'Social Boost API doc'

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('accounts.urls')),
    url(r'^my/posts/', include('posts.urls')),
    url(r'^my/likes/', include('actions.urls')),
    url(r'^api-auth/', include('rest_framework.urls')),
    url(r'^api-token-auth/', obtain_jwt_token),
    url(r'^api-token-refresh/', refresh_jwt_token),
    url(
        r'^docs/',
        include_docs_urls(title=API_TITLE,
                          permission_classes=(permissions.AllowAny, ))),
    url(r'^static/(?P<path>.*)$', serve,
        {'document_root': settings.STATIC_ROOT}),
]
Exemplo n.º 29
0
    url(r'^$', home, name='home'),

    #  which is a regular expression that takes the desired urls and passes as an argument
    # the filename, i.e. robots.txt or humans.txt.
    url(r'^(?P<filename>(robots.txt)|(humans.txt))$',
        home_files, name='home-files'),

    # Wire up our API using automatic URL routing.
    url(r'^api/', include(router.urls,)),

    #url(r'^api/forgot-password/$', UpdatePassword.as_view()),

    # url(r'^api/teams/(?P<name>[-\w. ]+)/?', include(router.urls,)),
    url(r'^api/teams/(?P<name>[-\w.]+(?:%20[-\w.]+)*)/?', include(router.urls,)),

    #url(r'^api/matchs/$', MatchViewSet.as_view({'get': 'list'}), 'matchs-list'),



    # If you're intending to use the browsable API you'll probably also want to add REST framework's
    # login and logout views.
    url(r'^api-auth/', include('rest_framework.urls',
        namespace='rest_framework')),

    url(r'^rest-auth/', include('rest_auth.urls')),

    url(r'^docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION))


]
Exemplo n.º 30
0
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from rest_framework.documentation import include_docs_urls

urlpatterns = [
    path(r'', include('rbac.urls')),
    path(r'', include('cmdb.urls')),
    path(r'', include('deployment.urls')),
    path('docs/', include_docs_urls()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 31
0
from rest_framework.documentation import include_docs_urls
from django.conf.urls.static import static
from django.conf.urls import url, include
from django.conf import settings
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='TTS API')),
    url(r'^', include('core.urls', namespace='core'))
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 32
0
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('app.urls')),
    path('docs/', include_docs_urls(title='API Documentation'))
]
Exemplo n.º 33
0
    url(r'^diary/', include('pepysdiary.diary.urls')),
    url(r'^letters/', include('pepysdiary.letters.urls')),
    url(r'^encyclopedia/', include('pepysdiary.encyclopedia.urls')),
    url(r'^indepth/', include('pepysdiary.indepth.urls')),
    url(r'^news/', include('pepysdiary.news.urls')),
    url(r'^annotations/', include('django_comments.urls')),
    url(r'^account/', include('pepysdiary.membership.urls')),

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


# API stuff

urlpatterns += [
    url(r'^api/docs/', include_docs_urls(title='The Diary of Samuel Pepys API')),

    url(r'^api/v1/', include('pepysdiary.api.urls')),
]



admin.site.site_header = 'The Diary of Samuel Pepys admin'

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
   ]
Exemplo n.º 34
0
import xadmin
from rest_framework.documentation import include_docs_urls
from rest_framework.routers import DefaultRouter

from articles.views import ArticlesViewSet, CategorysViewSet, TagsViewSet, HotArticleSet, CardArticleSet, TimeLineset

router = DefaultRouter()

#文章分类
router.register(r'category', CategorysViewSet, base_name="category")
#标签
router.register(r'tag', TagsViewSet, base_name="tag")
#热读
router.register(r'hotarticle', HotArticleSet, base_name="hotarticle")
#轮播卡片
router.register(r'cardarticle', CardArticleSet, base_name="cardarticle")
#时间线
router.register(r'timeline', TimeLineset, base_name="timeline")
#文章
router.register(r'article', ArticlesViewSet, base_name="article")

urlpatterns = [
    path('xadmin/', xadmin.site.urls),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('api-auth/', include('rest_framework.urls')),  #rdf登录认证
    path('docs/', include_docs_urls(title="文档")),  #rdf文档
    path('', include(router.urls)),
]
media_root = os.path.join(settings.BASE_DIR, settings.MEDIA_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=media_root)
Exemplo n.º 35
0
from django.conf.urls import url, include
from rest_framework.documentation import include_docs_urls


urlpatterns = (
    url(r'^auth/', include('djoser.urls.base')),
    url(r'^auth/', include('djoser.urls.authtoken')),
    url(r'^auth/', include('djoser.urls.jwt')),
    url(r'^auth/', include('djoser.social.urls')),
    url(r'^docs/', include_docs_urls()),
)
Exemplo n.º 36
0
authorization_urlpatterns = [
    url(r'^oauth2/', include('lego.apps.oauth.urls')),
    url(r'', include((jwt_urlpatterns, 'jwt'), namespace='jwt')),
    url(r'^login/',
        login, {'template_name': 'authorization/login.html'},
        name='login'),
    url(r'^logout/', logout, {'next_page': '/'}, name='logout'),
]

urlpatterns = [
    url(r'^api/', include('lego.api.urls', namespace='api')),
    url(r'^authorization/', include(authorization_urlpatterns)),
    url(r'^', include(health_urlpatterns)),
    url(
        r'^api-docs/',
        include_docs_urls(title=settings.SITE['name'],
                          description=settings.SITE['slogan'],
                          patterns=api,
                          schema_url='/api')),
    url(r'^$',
        TemplateView.as_view(template_name='landing.html'),
        name='landing_page'),
]

if 'debug_toolbar' in settings.INSTALLED_APPS:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]
Exemplo n.º 37
0
schema_view = get_schema_view(
    title='Barberscore API',
)

urlpatterns = [
    path('', lambda r: HttpResponseRedirect('admin/')),
    path('admin/', admin.site.urls),
    path('api/', include('api.urls')),
    path('bhs/', include('apps.bhs.urls')),
    path('cmanager/', include('apps.cmanager.urls')),
    path('stage/', include('apps.stage.urls')),
    path('rq/', include('django_rq.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('schema/', schema_view),
    path('docs/', include_docs_urls(title='Barberscore Documentation')),
    path('robots.txt', lambda r: HttpResponse("User-agent: *\nDisallow: /", content_type="text/plain")),
]

if settings.DEBUG and settings.DJANGO_SETTINGS_MODULE == 'settings.dev':
    import debug_toolbar
    urlpatterns += [
        re_path(
            r'^media/(?P<path>.*)$',
            serve, {
                'document_root': settings.MEDIA_ROOT,
            }
        ),
        path('__debug__/', include(debug_toolbar.urls)),
    ]
Exemplo n.º 38
0
router.register(r'course', CourseViewset, base_name="course")

router.register(r'sign', SignViewset, base_name="sign")

router.register(r'signDetail', SignDetailViewset, base_name="signDetail")

router.register(r'teacherCourse', TeacherCourseViewset, base_name="teacherCourse")

router.register(r'courseSign', CourseSignViewset, base_name="courseSign")

router.register(r'signSignDetail', SignSignDetailViewset, base_name="signSignDetail")

router.register(r'courseStudent', CourseStudentViewset, base_name="courseStudent")

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='My API title')),
    url(r'^api-auth/', include('rest_framework.urls')),
    url(r'^api/', include(router.urls)),

    url(r'^$', TemplateView.as_view(template_name="index.html"), name="index"),

    # drf 自带auth
    url(r'^api-token-auth/', views.obtain_auth_token),

    # jwt auth
    url(r'^login/', obtain_jwt_token),

]
Exemplo n.º 39
0
from rest_framework import routers
from rest_framework.documentation import include_docs_urls

from django.urls import path, include

from .views import MarkdownToHtmlViewSet, PageViewSet

router = routers.SimpleRouter()
router.register("pages", PageViewSet)

urlpatterns = [
    path("docs/", include_docs_urls(title="ahernp.com")),
    path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
    path(
        "markdown-to-html",
        MarkdownToHtmlViewSet.as_view({"post": "update"}),
        name="markdown-to-html",
    ),
    path("", include(router.urls)),
]
Exemplo n.º 40
0
api_router.register(r'users', views.UserViewSet)
api_router.register(r'analysis', views.AnalysisViewSet)
api_router.register(r'analysis_tracks',
                    views.AnalysisTrackViewSet,
                    base_name='analysistrack')
api_router.register(r'annotation_tracks', views.AnnotationTrackViewSet)
api_router.register(r'annotations', views.AnnotationViewSet)
api_router.register(r'providers', views.ProviderViewSet)
# api_router.register(r'provider_identifiers', views.ProviderIdentifierViewSet,
#                     base_name='provideridentifier')

urlpatterns = [
    # ----- API ---------
    url(r'^api/', include(api_router.urls)),
    # Docs
    url(r'^api/docs/', include_docs_urls(title='Timeside Web API')),
    # API endpoint for Generating Authentification token
    url(r'^api/token-auth/', authtoken_views.obtain_auth_token),
    # Temporary Endpoint to get CSRF Token
    url(r'^api/token-csrf/',
        views.Csrf_Token.as_view({'get': 'list'}),
        name='get_csrf_token'),
    # Items
    url(r'^api-token-auth/', obtain_auth_token, name='api_token_auth'),
    url('^api/schema/$', schema_view),
    url(
        r'^api/items/(?P<uuid>[0-9a-z-]+)/',
        include([
            url(r'^waveform/',
                views.ItemWaveView.as_view(),
                name="item-waveform"),
Exemplo n.º 41
0
from django.conf.urls import url, include
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
from rest_framework_jwt.views import obtain_jwt_token

from goards_api import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='Goards API', description='RESTful API for Goards')),

    url(r'^$', views.api_root),
    url(r'^', include('auth.urls', namespace='auth')),
    url(r'^', include('users.urls', namespace='users')),
    url(r'^', include('goals.urls', namespace='goals')),
]
Exemplo n.º 42
0
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from .views import BookView, BookUpdate, UserSignUp

urlpatterns = [
    path('', BookView.as_view(), name='add-book'),
    path('<int:id>/', BookUpdate.as_view(), name='update-book'),
    path('signup/', UserSignUp.as_view(), name='add-user'),
    path('auth/', include('rest_framework.urls')),
    path('docs/', include_docs_urls(title='GOODREADS', public=False)),
]
Exemplo n.º 43
0
"""
URLConf for test suite.

We need only the docs urls for DocumentationRenderer tests.
"""
from django.conf.urls import url

from rest_framework.compat import coreapi
from rest_framework.documentation import include_docs_urls

if coreapi:
    urlpatterns = [
        url(r'^docs/', include_docs_urls(title='Test Suite API')),
    ]
else:
    urlpatterns = []
Exemplo n.º 44
0
"""FreeFinderBackend URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path
from django.conf.urls import url, include
from rest_framework.documentation import include_docs_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    url(
        'docs/',
        include_docs_urls(title='Todo API',
                          description='RESTful API for Todo')),
    url('profile/', include(('profile.urls', 'profile'), namespace='profile')),
]
Exemplo n.º 45
0
from rest_framework.routers import DefaultRouter

from . import views


router = DefaultRouter()
router.register(r'business_units', views.BusinessUnitViewSet)
router.register(r'conditions', views.ConditionViewSet)
router.register(r'facts', views.FactViewSet)
router.register(r'inventory', views.InventoryViewSet)
router.register(r'machine_groups', views.MachineGroupViewSet)
router.register(r'machines', views.MachineViewSet)
router.register(r'pending_apple_updates', views.PendingAppleUpdatesViewSet)
router.register(r'pending_updates', views.PendingUpdatesViewSet)
router.register(r'plugin_script_rows', views.PluginScriptRowViewSet)
router.register(r'profiles', views.ProfileViewSet)
router.register(r'saved_searches', views.SavedSearchViewSet)


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

# Include the docs separatly, so we can use the v2 URLs above to filter
# out the older API schema from the docs.
urlpatterns.append(
    url(r'^docs/', include_docs_urls(
        title='Sal REST API', schema_url='/api/v2/', patterns=urlpatterns)))
Exemplo n.º 46
0
    # DRF 后台登录 API 接口
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),

    # 处理图片显示的url,使用Django自带serve,
    # 传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT
    url(r'media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),

    # # 商品列表页
    # path('goods/', goods_list.as_view(), name="goods-list"),
    # 全局url的配置
    url(r'^', include(router.urls)),

    # DRF自动文档, 方便前后端交互的文档
    url(r'docs/', include_docs_urls(title="DRF SHOP DOCS")),

    # drf自带的登录注册验证, 生成token值
    url(r'^api-token-auth/', token_views.obtain_auth_token),

    # jwt的token认证, 验证jwt的token是否匹配
    url(r'^login/$', obtain_jwt_token),

    # 支付宝返回接口
    url(r'alipay/return/', AliPayView.as_view(), name="alipay"),

    # 第三方登录接口url
    url(r'', include('social_django.urls', namespace='social')),

    # 匹配前端接口
    url(r'^web/', webViews),
Exemplo n.º 47
0
"""mysite URL Configuration

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.urls import include, url
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
from django.views.generic.base import RedirectView

urlpatterns = [
    url(r'^',include('user_app.urls')),
    url(r'^',include('profile_app.urls')),
    url(r'^',include('provider_profile_app.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^docs/', include_docs_urls(title='API Info'), name='APIInfo'),
    url(r'^.*$', RedirectView.as_view(url='/docs/', permanent=False)),
]

Exemplo n.º 48
0
    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.conf import settings
from django.urls import include, re_path
from rest_framework.authentication import BasicAuthentication
from rest_framework.documentation import include_docs_urls
from rest_framework.permissions import IsAuthenticated
from rest_framework_nested import routers

from api.restful.viewset import InventoryViewSet
from django.conf.urls.static import static

# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'inventory', InventoryViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.

urlpatterns = [
    re_path('^api/', include(router.urls)),
    re_path('^docs/', include_docs_urls(title='INVENTORY APIs',
                                        authentication_classes=[
                                            BasicAuthentication],
                                        permission_classes=[IsAuthenticated])),
    re_path(r'^', include('health_check.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 49
0
from django.conf.urls import url, include
from rest_framework import routers
from archeryapi import views
from rest_framework.documentation import include_docs_urls
from rest_framework.urlpatterns import format_suffix_patterns

API_TITLE = 'Archery API'
API_DESCRIPTION = 'Archery is an opensource vulnerability assessment and management tool which helps developers and ' \
                  'pentesters to perform scans and manage vulnerabilities. Archery uses popular opensource tools to ' \
                  'perform comprehensive scaning for web application and network. It also performs web application ' \
                  'dynamic authenticated scanning and covers the whole applications by using selenium. The developers ' \
                  'can also utilize the tool for implementation of their DevOps CI/CD environment. '

router = routers.DefaultRouter()

urlpatterns = [
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION, public=True, )),
    # url(r'^api', include('rest_framework_docs.urls')),
    url(r'webscan/', views.WebScan.as_view()),
    url(r'networkscan/', views.NetworkScan.as_view()),
    url(r'project/', views.Project.as_view()),
    url(r'webscanresult/', views.WebScanResult.as_view()),
    url(r'networkscanresult/', views.NetworkScanResult.as_view()),

]

urlpatterns = format_suffix_patterns(urlpatterns)
Exemplo n.º 50
0
from django.conf.urls import include, url
from rest_framework.documentation import include_docs_urls

from examples.rest import router
from .views import index

urlpatterns = [
    url(r'^$', index, name='index'),
    url(r'^', include(router.urls)),
    url(r'^dynamicforms/', include('dynamicforms.urls')),
    url(r'^api-docs/', include_docs_urls(title='Example API documentation')),
]
Exemplo n.º 51
0
    # # These three api are shortcut api to start/stop/initialize application, not normally used
    # url(r'^api/v1/application/(?P<pk>[0-9]+)/start$', app_api.ApplicationStart.as_view()),
    # url(r'^api/v1/application/(?P<pk>[0-9]+)/stop$', app_api.ApplicationStop.as_view()),
    # url(r'^api/v1/application/(?P<pk>[0-9]+)/init$', app_api.ApplicationInit.as_view()),


    # Action API
    url(r'^api/v1/interval/$', action_api.IntervalScheduleList.as_view()),
    url(r'^api/v1/interval/(?P<pk>[0-9]+)/$', action_api.IntervalScheduleDetail.as_view()),
    url(r'^api/v1/crontab/$', action_api.CrontabScheduleList.as_view()),
    url(r'^api/v1/crontab/(?P<pk>[0-9]+)/$', action_api.CrontabScheduleDetail.as_view()),
    url(r'^api/v1/solar/$', action_api.SolarScheduleeList.as_view()),
    url(r'^api/v1/solar/(?P<pk>[0-9]+)/$', action_api.SolarScheduleDetail.as_view()),

    url(r'^api/v1/action/$', action_api.Action.as_view()),

    url(r'^api/v1/appaction/$', action_api.AppActionGetList.as_view()),
    url(r'^api/v1/appaction/create/(?P<action>[a-zA-Z0-9_-]+)/$', action_api.AppActionAddList.as_view()),
    url(r'^api/v1/appaction/(?P<pk>[0-9]+)/$', action_api.AppActionDetail.as_view()),

    url(r'^api/v1/dscaction/$', action_api.DSCActionGetList.as_view()),
    url(r'^api/v1/dscaction/create/(?P<action>[a-zA-Z0-9_-]+)/$', action_api.DSCActionAddList.as_view()),
    url(r'^api/v1/dscaction/(?P<pk>[0-9]+)/$', action_api.DSCActionDetail.as_view()),

    url(r'^api/v1/bigipaction/$', action_api.BigipActionGetList.as_view()),
    url(r'^api/v1/bigipaction/create/(?P<action>[a-zA-Z0-9_-]+)/$', action_api.BigipActionAddList.as_view()),
    url(r'^api/v1/bigipaction/(?P<pk>[0-9]+)/$', action_api.BigipActionDetail.as_view()),

    # REST API Doc
    url(r'^docs/', include_docs_urls(title=API_TITLE))
]
Exemplo n.º 52
0
"""research_sys URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('apps.apis')),
    path('api/docs/', include_docs_urls(title='form apis')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 53
0
from user_operation.views import UserFavViewset
from utils.file_views import UploadFileView, DeleteFileView

router = DefaultRouter()    # 利用了ViewSet的重载as_view()方法进行请求方法和处理函数的动态绑定(简单好用,只需要逐一register,然后urls函数即可)
router.register(r'cases', CasesListViewSet, base_name="cases")      # 案例列表的相关操作
router.register(r'categorys', CategoryViewset, base_name="categorys")       # 案例类别的相关操作
router.register(r'questions', QuestionsListViewSet, base_name="questions")      # 问题列表的相关操作
router.register(r'hotsearchs', HotSearchsViewset, base_name="hotsearchs")       # 热搜案例的相关操作
router.register(r'users', UserViewset, base_name="users")       # 用户的相关操作
router.register(r'userfavs', UserFavViewset, base_name="userfavs")      # 用户收藏的相关操作
router.register(r'banners', BannerViewset, base_name="banners")     # 轮播图的相关操作

urlpatterns = [
    url(r'^', include(router.urls)),        # 将调用刚才注册到router的各个ViewSet的as_view()方法,得到最终的URL映射配置
    url(r'^', include('favicon.urls')),     # 注册收藏/网页标签图标请求的处理函数
    url(r'^uploadfile/(.+)/$', UploadFileView.as_view()),    # 上传文件接口
    url(r'^deletefile/(.+)/$', DeleteFileView.as_view()),    # 删除文件接口
    url(r'^hotcategory/', HotCategoryView.as_view()),   # 获取案例数量最多的若干个案例类型
    url(r'^picturecodes/', PictureCodeView.as_view(), name='picturecodes'),       # 获取验证码图片
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),     # 默认的通过账号和密码进行验证的方式(login和logout方法)
    url(r'docs/', include_docs_urls(title="APP Inventor案例库")),      # 自动生成的API说明文档
    url(r'^api-token-auth/', views.obtain_auth_token),      # drf自带的token认证模式(一般称为Session模式)
    url(r'^login/', obtain_jwt_token),      # jwt的认证接口(较之drf自带的认证模式,占用的服务器端资源更少,安全性更高)
    url(r'^captcha/', include('captcha.urls')),     # django-simple-captcha模块用于获取图片的URL
]

if DEBUG:
    urlpatterns.extend([
        url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),     # path 将作为第二参数传到server进行处理
    ])
Exemplo n.º 54
0
"""netplas URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include
from django.http import HttpResponseRedirect
from rest_framework.documentation import include_docs_urls
from api.v1.permissions import DocumentAuthenticated

urlpatterns = [
    path('', lambda r: HttpResponseRedirect('admin/')),
    path('admin/', admin.site.urls),
    path('api/', include('api.urls')),
    path(
        'docs/',
        include_docs_urls(title='Documentation',
                          permission_classes=[DocumentAuthenticated])),
]
Exemplo n.º 55
0
from django.conf import settings
from django.conf.urls import (include,
                              url)
from django.views.decorators.csrf import csrf_exempt
from rest_framework.documentation import include_docs_urls

from treeherder.webapp.api import urls as api_urls

urlpatterns = [
    url(r'^api/', include(api_urls)),
    url(r'^docs/', include_docs_urls(title='REST API Docs')),
]

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]

if settings.GRAPHQL:
    from graphene_django.views import GraphQLView
    from treeherder.webapp.graphql.schema import schema
    urlpatterns += [
        url(r'^graphql$',
            csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)),
            name='graphql'),
    ]
Exemplo n.º 56
0
Arquivo: urls.py Projeto: fiqus/coobs
from rest_framework.documentation import include_docs_urls


router = routers.DefaultRouter()
router.register(r'cooperatives', CooperativeView)
router.register(r'principles', PrincipleView, basename="Principle")
router.register(r'actions', ActionView, basename="Action")
router.register(r'periods', PeriodView, basename="Period")
router.register(r'partners', PartnerView, basename="Partner")
router.register(r'dashboard', DashboardView, basename="Dashboard")
router.register(r'balance', BalanceView, basename="Balance")
router.register(r'sdg-balance', SDGBalanceView, basename="BalanceODS")
router.register(r'actions-ranking', ActionsRankingView, basename="ActionsRanking")
router.register(r'my-stats', PartnerStatsView, basename="PartnerStats")
router.register(r'sustainable-development-goals', SustainableDevelopmentGoalView, basename="SustainableDevelopmentGoal")
router.register(r'sdg-objectives', SDGObjectiveView, basename="SDGObjective")
router.register(r'sdg-monitoring', SDGMonitoringView, basename="SDGMonitoring")

urlpatterns = [
    path('', RedirectView.as_view(url='api/')),
    path('docs/', include_docs_urls(title='COOBS API', permission_classes=[], public=False)),
    path('admin/', admin.site.urls),
    path('api/', include(router.urls)),
    path('api/public-actions/', PublicActionView.as_view(), name='public_actions'),
    path('api/public-actions/<int:id>', PublicActionView.as_view(), name='public_action_detail'),
    path('api/token/', MyTokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
    path('api/token/verify/', TokenVerifyView.as_view(), name='token_verify'),
    url(r'^api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
]
Exemplo n.º 57
0
Arquivo: urls.py Projeto: pinry/pinry
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls

from core.views import drf_router


admin.autodiscover()


urlpatterns = [
    # drf api
    url(r'^api/v2/', include(drf_router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
    url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),

    # old api and views
    url(r'^admin/', include(admin.site.urls)),
    url(r'', include('core.urls', namespace='core')),
    url(r'', include('users.urls', namespace='users')),
]


if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += [
        url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
    ]

if settings.IS_TEST:
Exemplo n.º 58
0
v1_api_path = path('v1/', include((router.urls + [v1_scope_path], 'v1')))

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-tokens/', get_api_tokens_view),
    path('accounts/profile/', show_login),
    path('accounts/login/', LoginView.as_view()),
    path('accounts/logout/', LogoutView.as_view()),
    path('accounts/', include(auth_backends.urls, namespace='auth_backends')),
    path('accounts/', include(social_auth_urls, namespace='social')),
    path('oauth2/applications/', permission_denied),
    path('oauth2/authorize/', TunnistamoAuthorizationView.as_view(), name="oauth2_authorize"),
    path('oauth2/', include(oauth2_provider.urls, namespace='oauth2_provider')),
    re_path(r'^openid/authorize/?$', TunnistamoOidcAuthorizeView.as_view(), name='authorize'),
    re_path(r'^openid/end-session/?$', TunnistamoOidcEndSessionView.as_view(), name='end-session'),
    path('openid/', include(oidc_provider.urls, namespace='oidc_provider')),
    re_path(r'^\.well-known/openid-configuration/?$', OIDCProviderInfoView.as_view(), name='root-provider-info'),
    re_path(r'^user/(?P<username>[\w.@+-]+)/?$', UserView.as_view()),
    path('user/', UserView.as_view()),
    path('jwt-token/', GetJWTView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', LogoutView.as_view()),
    path('email-needed/', EmailNeededView.as_view(), name='email_needed'),
    v1_api_path,
    path('docs/', include_docs_urls(title='Tunnistamo API v1', patterns=[v1_api_path],
                                    generator_class=AllEnglishSchemaGenerator)),
]

if settings.DEBUG:
    static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Exemplo n.º 59
0
        view=UserProfileUpdateView.as_view(), name='user-profile'),
     url(r'^alert-test/$',
        view=AlertTestView.as_view(), name='alert-test'),
     url(r'^alert-test-plugin/$',
        view=AlertTestPluginView.as_view(), name='alert-test-plugin'),
     url(r'^plugin-settings/$',
        view=RedirectView.as_view(url='global/', permanent=False), name='plugin-settings-global'),
     url(r'^plugin-settings/(?P<plugin_name>.+)/$',
        view=PluginSettingsView.as_view(), name='plugin-settings'),
     url(r'^user/(?P<pk>\d+)/profile/(?P<alerttype>.+)/',
        view=UserProfileUpdateAlert.as_view(), name='update-alert-user-data'),
     url(r'^admin/', include(admin.site.urls)),
     # Comment below line to disable browsable rest api
     url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
     url(r'^api/', include(rest_urls.router.urls)),
     url(r'^docs/', include_docs_urls(title="Cabot API", description="An API to create and view Cabot checks and services."))
]

def append_plugin_urls():
    """
    Appends plugin specific URLs to the urlpatterns variable.
    """
    global urlpatterns
    for plugin in settings.CABOT_PLUGINS_ENABLED_PARSED:
        try:
            _module = import_module('%s.urls' % plugin)
        except ImportError:
            pass
        else:
            urlpatterns += [
                url(r'^plugins/%s/' % plugin, include('%s.urls' % plugin))
Exemplo n.º 60
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.schemas import get_schema_view

schema_view = get_schema_view(title='Hospital API')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('beds.urls')),
    path('api-auth', include('rest_framework.urls')),
    path('api/v1/rest-auth/', include('rest_auth.urls')),
    path('api/v1/rest-auth/registration/',
         include('rest_auth.registration.urls')),
    path('docs/', include_docs_urls(title='Hospital API')),
    path('schema/', schema_view),
]