def prepend_urls(self): return [ re_path( r'^(?P<resource_name>{})/geocode{}$'.format( self._meta.resource_name, trailing_slash()), self.wrap_view('geocode'), name='api_geocode' ), ]
def urls(self, name_prefix=None): """Override the DjangoResource ``urls`` class method so the detail view accepts a GUID parameter instead of PK. """ return [ path('', self.as_list(), name=self.build_url_name('list', name_prefix)), path('fast/', self.as_view('list_fast'), name=self.build_url_name('list_fast', name_prefix)), re_path(r'^(?P<guid>[0-9A-Za-z-_@\'&\.]+)/$', self.as_detail(), name=self.build_url_name('detail', name_prefix)), ]
def get_urls(self): """ Add the entries view to urls. """ urls = super(FormAdmin, self).get_urls() extra_urls = [ re_path("^(?P<form_id>\d+)/entries/$", self.admin_site.admin_view(self.entries_view), name="form_entries"), re_path("^(?P<form_id>\d+)/entries/show/$", self.admin_site.admin_view(self.entries_view), {"show": True}, name="form_entries_show"), re_path("^(?P<form_id>\d+)/entries/export/$", self.admin_site.admin_view(self.entries_view), {"export": True}, name="form_entries_export"), re_path("^file/(?P<field_entry_id>\d+)/$", self.admin_site.admin_view(self.file_view), name="form_file"), ] return extra_urls + urls
def urlconf(): if django.VERSION < (1, 9): included_url_conf = ( url(r'^foo/bar/(?P<param>[\w]+)', lambda x: ''), ), '', '' else: included_url_conf = (( url(r'^foo/bar/(?P<param>[\w]+)', lambda x: ''), ), '') if django.VERSION >= (2, 0): from django.urls import path, re_path example_url_conf = ( re_path(r'^api/(?P<project_id>[\w_-]+)/store/$', lambda x: ''), re_path(r'^report/', lambda x: ''), re_path(r'^example/', include(included_url_conf)), path('api/v2/<int:project_id>/store/', lambda x: '') ) return example_url_conf
def get_urls(self): from django.urls import re_path from functools import update_wrapper # Define a wrapper view def wrap(view): def wrapper(*args, **kwargs): return self.admin_site.admin_view(view)(*args, **kwargs) return update_wrapper(wrapper, view) # Add the custom button url urlpatterns = [re_path('(.+)/', wrap(self.button_view_dispatcher))] return urlpatterns + super(ButtonAdmin, self).get_urls()
def get_urls(self): from django.urls import include, path, re_path # Since this module gets imported in the application's root package, # it cannot import models from other applications at the module level, # and django.contrib.contenttypes.views imports ContentType. from django.contrib.contenttypes import views as contenttype_views def wrap(view, cacheable=False): def wrapper(*args, **kwargs): return self.admin_view(view, cacheable)(*args, **kwargs) wrapper.admin_site = self return update_wrapper(wrapper, view) # Admin-site-wide views. urlpatterns = [ path('', wrap(self.index), name='index'), path('login/', self.login, name='login'), path('logout/', wrap(self.logout), name='logout'), path('password_change/', wrap(self.password_change, cacheable=True), name='password_change'), path( 'password_change/done/', wrap(self.password_change_done, cacheable=True), name='password_change_done', ), path('jsi18n/', wrap(self.i18n_javascript, cacheable=True), name='jsi18n'), path( 'r/<int:content_type_id>/<path:object_id>/', wrap(contenttype_views.shortcut), name='view_on_site', ), ] # Add in each model's views, and create a list of valid URLS for the # app_index valid_app_labels = [] for model, model_admin in self._registry.items(): urlpatterns += [ path('%s/%s/' % (model._meta.app_label, model._meta.model_name), include(model_admin.urls)), ] if model._meta.app_label not in valid_app_labels: valid_app_labels.append(model._meta.app_label) # If there were ModelAdmins registered, we should have a list of app # labels for which we need to allow access to the app_index view, if valid_app_labels: regex = r'^(?P<app_label>' + '|'.join(valid_app_labels) + ')/$' urlpatterns += [ re_path(regex, wrap(self.app_index), name='app_list'), ] return urlpatterns
def get_urls(self): # Add the URL of our custom 'add_view' view to the front of the URLs # list. Remove the existing one(s) first from django.urls import re_path def wrap(view): def wrapper(*args, **kwargs): return self.admin_site.admin_view(view)(*args, **kwargs) return update_wrapper(wrapper, view) info = self.model._meta.app_label, self.model._meta.model_name view_name = '%s_%s_add' % info return [ re_path('^!add/$', wrap(self.add_view), name=view_name), ] + self.remove_url(view_name)
def app_resolver(app_name=None, pattern_kwargs=None, name=None): ''' Registers the given app_name with DMP and adds convention-based url patterns for it. This function is meant to be called in a project's urls.py. ''' urlconf = URLConf(app_name, pattern_kwargs) resolver = re_path( '^{}/?'.format(app_name) if app_name is not None else '', include(urlconf), name=urlconf.app_name, ) # this next line is a workaround for Django's URLResolver class not having # a `name` attribute, which is expected in Django's technical_404.html. resolver.name = getattr(resolver, 'name', name or app_name) return resolver
def static(prefix, view=serve, **kwargs): """ Return a URL pattern for serving files in debug mode. from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) """ if not prefix: raise ImproperlyConfigured("Empty static prefix not permitted") elif not settings.DEBUG or '://' in prefix: # No-op if not in debug mode or a non-local prefix. return [] return [ re_path(r'^%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), view, kwargs=kwargs), ]
from django.urls import path, re_path from articles import views urlpatterns = [ path('articles/', views.archive, name='archive'), re_path(r'^article/(?P<article_id>\d+)/$', views.get_article, name='get_article'), re_path(r'^article/new', views.create_post, name='create_post'), ]
name="email_digest_switch"), path("notifications/renderer/digest/weekly/", weekly_digest, name="render_weekly_digest"), path("notifications/renderer/digest/daily/<slug:user_slug>/", daily_digest, name="render_daily_digest"), path("docs/<slug:doc_slug>/", docs, name="docs"), path("godmode/", god_settings, name="god_settings"), path("godmode/dev_login/", debug_dev_login, name="debug_dev_login"), path("godmode/random_login/", debug_random_login, name="debug_random_login"), # feeds path("sitemap.xml", sitemap, {"sitemaps": sitemaps}, name="sitemap"), path("posts.rss", NewPostsRss(), name="rss"), # keep these guys at the bottom re_path(r"^{}/$".format(POST_TYPE_RE), feed, name="feed_type"), re_path(r"^{}/{}/$".format(POST_TYPE_RE, ORDERING_RE), feed, name="feed_ordering"), path("<slug:post_type>/<slug:post_slug>/", show_post, name="show_post"), ] if settings.DEBUG: import debug_toolbar urlpatterns = [path("__debug__/", include(debug_toolbar.urls)) ] + urlpatterns
from django.urls import path,re_path from . import views app_name = 'posts' urlpatterns = [ path('',views.PostList.as_view(),name='all'), path('new/',views.CreatePost.as_view(),name='create'), re_path(r"by/(?P<username>[-\w]+)/$",views.UserPosts.as_view(),name="for_user"), re_path(r"by/(?P<username>[-\w]+)/(?P<pk>\d+)/$",views.PostDetail.as_view(),name="single"), path('delete/<int:pk>/',views.DeletePost.as_view(),name='delete') ]
from grandchallenge.profiles.forms import SignupFormExtra from grandchallenge.profiles.views import ( login_redirect, profile_edit_redirect, profile, signup, signin, signup_complete, profile_edit, ) urlpatterns = [ path( "signup/", signup, {"signup_form": SignupFormExtra}, name="profile_signup", ), path("signin/", signin, name="profile_signin"), path("signup_complete/", signup_complete, name="profile_signup_complete"), path("login-redirect/", login_redirect, name="login_redirect"), path("profile/edit/", profile_edit_redirect, name="profile_redirect_edit"), path("profile/", profile, name="profile_redirect"), re_path( r"^(?P<username>[\@\.\+\w-]+)/edit/$", profile_edit, name="userena_profile_edit", ), path("", include("userena.urls")), ]
path( 'password_reset_extra_email_context/', views.PasswordResetView.as_view(extra_email_context={'greeting': 'Hello!'})), path( 'password_reset/custom_redirect/', views.PasswordResetView.as_view(success_url='/custom/')), path( 'password_reset/custom_redirect/named/', views.PasswordResetView.as_view(success_url=reverse_lazy('password_reset'))), path( 'password_reset/html_email_template/', views.PasswordResetView.as_view( html_email_template_name='registration/html_password_reset_email.html' )), re_path( '^reset/custom/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(success_url='/custom/'), ), re_path( '^reset/custom/named/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(success_url=reverse_lazy('password_reset')), ), re_path( '^reset/post_reset_login/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(post_reset_login=True), ), re_path( '^reset/post_reset_login_custom_backend/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view( post_reset_login=True, post_reset_login_backend='django.contrib.auth.backends.AllowAllUsersModelBackend', ),
from django.contrib import admin from django.urls import include, re_path from . import views from django.contrib.auth.decorators import login_required admin.autodiscover() admin.site.login = login_required(admin.site.login) urlpatterns = [ re_path(r'^$', views.home, name='uwregistry'), re_path(r'^admin/', admin.site.urls), re_path(r'^saml/', include('uw_saml.urls')), re_path(r'^learn/?$', views.learn, name='learn'), re_path(r'^discover/?$', views.discover, name='discover'), re_path(r'^connect/?$', views.connect, name='connect'), re_path(r'^search/?$', views.search, name='search'), re_path(r'^service/add/?$', views.submit, name='submit'), re_path(r'^service/browse/?$', views.browse, name='browse'), re_path(r'^service/mine/?$', views.mine, name='mine'), re_path(r'^service/recent/?$', views.recent_activity, name='recentactivity'), re_path(r'^service/edit/(?P<nick>[-\w]+)/$', views.edit, name='edit'), re_path(r'^(?P<nick>[-\w]+)/$', views.service, name='service') ]
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: re_path(r'^', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: re_path(r'^', 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: re_path(r'^blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, re_path, include from . import views from django.contrib.auth import views as auth_views """ these paths are just random ones that I used to get a basic """ urlpatterns = [ path('', views.profile), re_path(r'^login/', auth_views.LoginView.as_view(template_name='users/login2.html'), name='login'), re_path(r'^signup/', views.signup, name='user_signup'), re_path(r'^profile/', views.profile, name='user_profile'), re_path(r'^logout/', views.logouting, name='user_logout'), re_path(r'^privacy/', views.privacy, name='privacy'), re_path(r'^terms/', views.terms, name='terms'), re_path(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',views.activate, name='activate'), re_path(r'facebook/', views.facebook_login,name='facebook_login'), ]
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), path( "users/", include("rgram.users.urls", namespace="users"), ), path( "images/", include("rgram.images.urls", namespace="images"), ), path( "notifications/", include("rgram.notifications.urls", namespace="notifications"), ), path("accounts/", include("allauth.urls")), # Your stuff: custom urls includes go here re_path(r'^.*/$', views.ReactAppView.as_view()) ] + static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT ) if settings.DEBUG: # This allows the error pages to be debugged during development, just visit # these url in browser to see how these error pages look like. urlpatterns += [ path( "400/", default_views.bad_request, kwargs={"exception": Exception("Bad Request!")}, ), path( "403/",
title="Snippets API", default_version='v1', description="Test description", terms_of_service="https://www.google.com/policies/terms/", contact=openapi.Contact(email="*****@*****.**"), license=openapi.License(name="BSD License"), ), validators=["flex", "ssv"], public=True, # permission_classes=(permissions.AllowAny,), permission_classes=(ReadOnlyPermissions, ), ) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ path('admin/', admin.site.urls), path('', include(router.urls)), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]
from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path(r'', consumers.ChatConsumer.as_asgi()), ]
from django.urls import re_path from django.contrib import admin from .views import (UserCreateAPIView, UserLoginAPIView) app_name = 'users-api' urlpatterns = [ re_path(r'^login/$', UserLoginAPIView.as_view(), name='login'), re_path(r'^register/$', UserCreateAPIView.as_view(), name='register'), ]
from django.conf import settings from django.urls import path, re_path, include, reverse_lazy from django.conf.urls.static import static from django.contrib import admin from django.views.static import serve from django.views.generic.base import RedirectView from rest_framework.authtoken import views from Reservations.apps import urls as APIUrls urlpatterns = [ path('admin/', admin.site.urls), path('api-token-auth/', views.obtain_auth_token), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), path('api/', include(APIUrls)), # the 'api-root' from django rest-frameworks default router # http://www.django-rest-framework.org/api-guide/routers/#defaultrouter re_path( r'^$', RedirectView.as_view(url=reverse_lazy('api-root'), permanent=False)), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
""" This ``urls.py`` is only used when running the tests via ``runtests.py``. As you know, every app must be hooked into yout main ``urls.py`` so that you can actually reach the app's views (provided it has any views, of course). """ from django.conf.urls import include from django.contrib import admin from django.urls import re_path admin.autodiscover() urlpatterns = [ re_path(r'^administration/', admin.site.urls), re_path(r'^s/', include('tinylinks.urls')), ]
from django.urls import include, path, re_path from .views import empty_view urlpatterns = [ path('', empty_view, name="named-url3"), re_path(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url4"), re_path(r'^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$', empty_view), path('included/', include('urlpatterns_reverse.included_named_urls2')), ]
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.conf.urls import url, include from django.urls import path, re_path from django.contrib.auth.views import LoginView, PasswordResetView from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required urlpatterns = [ path('admin/', admin.site.urls), path('', include('apps.producto.urls'), name='producto'), path('accounts/', include('apps.usuario.urls'), name='usuario'), path('accounts/', include('django.contrib.auth.urls')), re_path(r'^password_reset/$', auth_views.PasswordResetView.as_view( template_name="registration/password_reset_form.html", email_template_name="registration/password_reset_email.html", success_url=('/password_reset_done/'), ), name='password_reset' ), re_path(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'), re_path(r'^password_reset_done/', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'), re_path(r'^password_reset_complete/$',auth_views.PasswordResetCompleteView.as_view(), name="password_reset_complete"), ]
from django.views.generic import RedirectView from django.views.static import serve as static_serve from django.urls import include, path, re_path def robots_txt(request): permission = 'Allow' if settings.ENGAGE_ROBOTS else 'Disallow' return HttpResponse('User-agent: *\n{0}: /'.format(permission), content_type='text/plain') urlpatterns = [ path('', include('snippets.base.urls')), path('robots.txt', robots_txt), # Favicon re_path(r'^(?P<path>favicon\.ico)$', static_serve, {'document_root': settings.STATIC_ROOT}), # contribute.json url re_path(r'^(?P<path>contribute\.json)$', static_serve, {'document_root': settings.ROOT}), ] if settings.ENABLE_ADMIN: urlpatterns += [ path('admin/', admin.site.urls), ] admin.site.site_header = settings.SITE_HEADER admin.site.site_title = settings.SITE_TITLE elif settings.ADMIN_REDIRECT_URL: urlpatterns.append( path('admin/', RedirectView.as_view(url=settings.ADMIN_REDIRECT_URL)) )
from shieldServer import views, message, svm from chainServer import clock from chainServer import views as chain_views urlpatterns = [ path('admin/', admin.site.urls), path('index/', views.home), path('login/', views.login, name='login'), path('logout/', views.logout, name='logout'), path('addLending/', views.add_lending, name='addLending'), path('lendingResult/', views.lending_result, name='lendingResult'), path("mine/", clock.mine), path('receive/', chain_views.broadcastreceiver), path('repayment/', views.repayment, name='repayment'), path('repayment_repay/', views.repayment_repay, name='repayment_repay'), path('sendCode/', message.send_message, name='sendCode'), path('changePwd/', views.changePwd, name='changePwd'), path('query_svm/', svm.query_svm, name='query_svm'), path('get/', clock.get_blocks), path('user_management/', views.usermanage, name='usermanage'), path('delete_user/', views.deleteuser, name='deleteuser'), path('new_user/', views.new_user, name='newuser'), re_path(r'^index/(\w+).html$', views.others), path('alert/', views.alert_serach, name='alertsearch'), path('blacklist/', chain_views.blacklist_search, name='blacklistsearch'), path('alert_know/', views.alert_know, name='alertsearch'), path('accountinfo/', views.accountinfo, name="accountinfo"), path('lending_svm/', svm.lending_svm, name="lending_svm"), path('userManageEnter/', views.is_manager, name='is_manager'), ]
from django.urls import re_path from .views import votereply urlpatterns = [ re_path(r'^vote/(?P<reply_id>\d+)/$', votereply, name='sphquestions_votereply'), ]
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.urls import url, include from django.contrib import admin from django.urls import path, re_path from rest_framework_swagger.views import get_swagger_view from profiles.urls import subscription_router, sections_router, users_router schema_view = get_swagger_view(title='Collections API') urlpatterns = [ url(r'^$', schema_view, name='api'), path('admin/', admin.site.urls), re_path(r'rest-auth/', include('profiles.auth_urls')), re_path(r'^', include('profiles.urls')), ]
from django.conf.urls import url from django.urls import path,re_path from . import views app_name = 'WQPS' urlpatterns = [ path('index/', views.index, name="index"), path('login/', views.user_login, name="user_login"), path('predict/',views.predict, name="predict"), path('manage/',views.manage, name="manage"), path('logout/',views.user_logout, name="user_logout"), path('model/',views.model,name="model"), path('admin/',views.admin,name="admin"), re_path('',views.index), ]
from django.urls import path, re_path, include from rest_framework.authtoken.views import obtain_auth_token from . import views urlpatterns = [ re_path(r'sign-in/$', views.CustomObtainAuthToken.as_view(), name='login'), re_path(r'sign-up/', include('rest_auth.registration.urls')), ]
from django.urls import path, re_path from .views import dash_views, registration_views, form_views from django.contrib.auth import views as auth_views app_name = 'gas_dash' urlpatterns = [ # This is the home dashboard '/gas_dash' path('', dash_views.index, name='index'), # The registration view re_path(r'^signup/$', registration_views.signup, name='signup'), # This is the login page re_path(r'^login/$', auth_views.login, name='login'), # The logout page re_path(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'), # Add a stock path('stocks/add', form_views.add_stock, name='add_stock'), # Add a trade path('trade/add', form_views.add_trade, name='add_trade'), # This is a stock page '/gas_dash/<stock_id>' path('stocks/<int:stock_id>', dash_views.stock, name='stock'), # This is a stock trades page '/gas_dash/<stock_id>/trades' path('stocks/<int:stock_id>/trades', dash_views.trades, name='trades'), # This is a trade page '/gas_dash/<trade_id>' path('trade/<int:stock_id>', dash_views.trade, name='trade') ]
from professors.views import (professors_list, professor_profile, home_page, professors_search, about_page, terms_page) from accounts.views import activate, login_view, logout_view, register_view urlpatterns = [ path('', home_page), path('about/', about_page), path('admin/', admin.site.urls), path('login/', login_view), path('logout/', logout_view), path('professors/', professors_list), path('professors/<int:id>/', professor_profile), path('register/', register_view), path('search/', professors_search), re_path( r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', activate, name='activate'), path('terms/', terms_page), re_path(r'^password_reset/$', auth_views.PasswordResetView.as_view(), name='password_reset'), re_path(r'^password_reset/done/$', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'), re_path( r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'), re_path(r'^reset/done/$', auth_views.PasswordResetCompleteView.as_view(), name='password_reset_complete'),
"""applicants 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, re_path, include urlpatterns = [ path('admin/', admin.site.urls), re_path('api/v1/', include('applicants.app.applicants.urls')) ]
from django.urls import path, re_path from .views import StartGameView, GameProcessView app_name = 'server' urlpatterns = [ path('startgame/', StartGameView.as_view()), re_path('playershoot/(?P<coord>[^/]*)/', GameProcessView.as_view()) ]
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, re_path, include from app01 import views import pro from pro import urls urlpatterns = [ re_path(r'^admin/', admin.site.urls), # path('chen/<int:year>/<str:num>', views.home), path('home/', views.home), re_path(r'page/$', views.page), re_path(r'^stu_from/$', views.stufrom), re_path(r'^stu_model_from/$', views.stumodelfrom), re_path(r'^pro/', include('pro.urls')), # path('',pro.views.index), path('accounts/login/', pro.views.userlogin), path('accounts/logout/', pro.views.userlogout), ]
router.register(r'codes', SmsCodeViewSet, base_name='code') router.register(r'register', UserRegisterViewset, base_name='register') router.register(r'answers', AnswerViewset, base_name='answer') router.register(r'topics', TopicViewset, base_name='topic') router.register(r'questions', QuestionViewset, base_name='question') router.register(r'votes', UserVoteViewSet, base_name='vote') router.register(r'flow_questions', UserFlowQuestionViewSet, base_name='flow_question') router.register(r'favs', UserFavViewSet, base_name='fav') urlpatterns = [ path('admin/', admin.site.urls), # 文件 path('meida/<path:path>', serve, {'document_root': MEDIA_ROOT}), # drf文档, title自定义 path('docs', include_docs_urls(title='Amir')), path('api-auth/', include('rest_framework.urls')), # API LOGIN path('login/', obtain_jwt_token), # API URL re_path('', include(router.urls)), ]
from django.urls import path, re_path from . import views app_name = "parcels" urlpatterns = [ path(r"find", views.find_parcels, name="find"), re_path(r"^loc_id/(F_[\d_]+)$", views.parcel_with_loc_id, name="lookup-by-loc"), re_path(r"^(?P<pk>\d+)$", views.view_parcel), ]
from django.contrib import admin from django.urls import path, re_path from super_admin import views urlpatterns = [ path('index/', views.index, name="table_index"), re_path('(?P<app_name>\w+)/(?P<table_name>\w+)/add/', views.table_obj_add, name="table_objs_add"), re_path('(?P<app_name>\w+)/(?P<table_name>\w+)/(?P<obj_id>\d+)/change/', views.table_obj_change, name="table_objs_change"), re_path('(?P<app_name>\w+)/(?P<table_name>\w+)/(?P<obj_id>\d+)/delete/', views.table_obj_delete, name="obj_delete"), re_path('(\w+)/(\w+)/', views.display_table_obj, name="table_objs"), path('pg_num/', views.pg_num, name="pg_num"), ]
from django.urls import include, path, re_path urlpatterns = [ path('foo/', lambda x: x, name='foo'), # This dollar is ok as it is escaped re_path(r'^\$', include([ path('bar/', lambda x: x, name='bar'), ])), ]
from django.urls import path, re_path import ordersapp.views as ordersapp app_name = 'ordersapp' urlpatterns = [ re_path(r'^$', ordersapp.OrderList.as_view(), name='orders_list'), re_path(r'^create/$', ordersapp.OrderItemsCreate.as_view(), name='order_create'), re_path(r'^read/(?P<pk>\d+)/$', ordersapp.OrderRead.as_view(), name='order_read'), re_path(r'^update/(?P<pk>\d+)/$', ordersapp.OrderItemsUpdate.as_view(), name='order_update'), re_path(r'^delete/(?P<pk>\d+)/$', ordersapp.OrderDelete.as_view(), name='order_delete'), re_path(r'^forming/complete/(?P<pk>\d+)/$', ordersapp.order_forming_complete, name='order_forming_complete'), ]
from rest_framework.urlpatterns import format_suffix_patterns from django.urls import re_path from api.nodes import views from constants.urls import INDEX_PATTERN, SEQUENCE_PATTERN cluster_nodes_urlpatterns = [ re_path(r'^cluster/nodes/?$', views.ClusterNodeListView.as_view()), re_path(r'^nodes/{}/?$'.format(SEQUENCE_PATTERN), views.ClusterNodeDetailView.as_view()), re_path(r'^nodes/{}/gpus/?$'.format(SEQUENCE_PATTERN), views.ClusterNodeGPUListView.as_view()), re_path(r'^nodes/{}/gpus/{}/?$'.format(SEQUENCE_PATTERN, INDEX_PATTERN), views.ClusterNodeGPUDetailView.as_view()), ] urlpatterns = format_suffix_patterns(cluster_nodes_urlpatterns)
#DJANGO Core from django.urls import re_path, include #REST FRAMEWORK Core from rest_framework import routers #INTERNAL Components from followprocess.process.api import views as api_views router = routers.DefaultRouter() router.register(r"process", api_views.ProcessApiView, basename="process") userprocess = api_views.UserProcessApiView.as_view() urlpatterns = [ re_path(r"v1/", include(router.urls)), #TODO Implement it in the API Root. Tip: Extends > BaseRouter() re_path(r"v1/user_process/$", userprocess, name="user_process"), re_path(r"v1/user_process/(?P<pk>\d+)/$", userprocess, name="delete_user_process"), ]
from django.urls import re_path, include from rest_framework.routers import DefaultRouter from .views import SmsCodeViewset, UserViewset app_name = "user" router = DefaultRouter() # 配置codes的url router.register('codes', SmsCodeViewset, basename="code") router.register('users', UserViewset, basename="users") urlpatterns = [re_path('^', include(router.urls))]
# ] from django.views.generic import TemplateView import xadmin from django.urls import path, re_path from enterprise.views import EnterView, EnterHomeView, EnterHomeChartView, \ Per_YearsChartView, PerYear_2015_ChartView, PerYear_2016_ChartView, PerYear_2017_ChartView # 要写上app的名字 from enterprise.views import ChartsView app_name = "enterprise" urlpatterns = [ # path('list/', xadmin.site.urls), path('list/', EnterView.as_view(), name='enter_list'), re_path('home/(?P<enter_id>\d+)/info', EnterHomeView.as_view(), name="enter_home"), #获取单个企业知识产权数据 re_path('home/(?P<enter_id>\d+)/perecharts', TemplateView.as_view(template_name='perecharts.html'), name='perecharts'), re_path('home/(?P<enter_id>\d+)/api/perecharts', EnterHomeChartView.as_view(), name='perecharts-url'), #单个企业三年年报数据(折线图) re_path('home/(?P<enter_id>\d+)/api/per_years_charts_years', Per_YearsChartView.as_view(), name='perecharts-url_years'), #单个企业2015年年报数据
from django.urls import re_path from groups.views import GroupsLaunchView from groups.views.group import GroupView from groups.views.roles import CanvasCourseRoles from groups.views.validate import GWSGroup, GWSGroupMembers urlpatterns = [ re_path(r'^$', GroupsLaunchView.as_view()), re_path(r'api/v1/group/(?P<id>[0-9]+)?$', GroupView.as_view()), re_path(r'api/v1/account/(?P<canvas_account_id>[0-9]+)/course_roles$', CanvasCourseRoles.as_view()), re_path(r'api/v1/uw/group/(?P<group_id>[a-zA-Z0-9\-\_\.]*)$', GWSGroup.as_view()), re_path(r'api/v1/uw/group/(?P<group_id>[a-zA-Z0-9\-\_\.]+)/membership$', GWSGroupMembers.as_view()), ]
"""image_clipper 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, re_path from clipper.views_base import ClipperView urlpatterns = [ # path('admin/', admin.site.urls), re_path(r'^(?:h_\d*,w_\d*)?/(?:https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/$', ClipperView.as_view(), name='clipper'), re_path(r'^(?:w_\d*,h_\d*)?/(?:https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/$', ClipperView.as_view(), name='clipper') ]
path('admin/how-to/', build_howto, name="admin_how_to"), path('admin/doc/', include('django.contrib.admindocs.urls')), path('admin/', include('admin.site.urls')), path('articles/', include('articles.urls.article_urls')), #path('comments/', include('tango_comments.urls')), path('contact/', include('contact_manager.urls')), path('photos/', include('photos.urls')), path('events/', include('happenings.urls')), # Uncomment if you're using the tango_user app. # Or just use your own profiles app. # path('profiles/', include('tango_user.urls')), path('video/', include('video.urls')), re_path( route=r'^vote/(?P<model_name>[-\w]+)/(?P<object_id>\d+)/(?P<direction>up|down)vote/$', view='voting.views.generic_vote_on_object', name="generic_vote" ), # Map these urls to appropriate login/logout views for your authentication system. #path('login/', auth_views.login, {'template_name': 'registration/login.html'}, name='auth_login'), #path('logout/', auth_views.logout, {'template_name': 'registration/logout.html'}, name='auth_logout'), # This url is just to provide example typography and show the typographic grid. path('examples/typography/', TemplateView, {'template_name': 'examples/typography.html'}, name='typography'), ] if settings.DEBUG is True: from django.conf.urls.static import static urlpatterns.append(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT))
# # dcolumn/dcolumns/tests/urls.py # try: from django.urls import re_path except: from django.conf.urls import url as re_path from . import views urlpatterns = [ re_path(r'^test-book-create/$', views.test_book_create_view, name='test-book-create'), re_path(r'^test-book-update/(?P<pk>\d+)/$', views.test_book_update_view, name='test-book-update'), re_path(r'^test-book-detail/(?P<pk>\d+)/$', views.test_book_detail_view, name='test-book-detail'), re_path(r'^test-book-list/$', views.test_book_list_view, name='test-book-list'), ]
from django.urls import path, re_path from . import views, list_views app_name = "article" urlpatterns = [ path('article-column/', views.article_column, name="article_column"), path('rename-column/', views.rename_article_column, name="rename_article_column"), path('del-column/', views.del_article_column, name="del_article_column"), path('article-post/', views.article_post, name="article_post"), path('article-list/', views.article_list, name="article_list"), re_path(r'^article-detail/(?P<id>\d+)/(?P<slug>[-\w]+)/$', views.article_detail, name="article_detail"), path('del-article/', views.del_article, name="del_article"), path('redit-article/<int:article_id>/', views.redit_article, name="redit_article"), path('list-article-titles/', list_views.article_titles, name="article_titles"), path('list-article-detail/<int:id>/<slug:slug>/', list_views.article_detail, name="list_article_detail"), ]
from django.urls import re_path from sphene.sphsearchboard.views import view_search_posts urlpatterns = [re_path(r'^$', view_search_posts, name='sphsearchboard_posts')]
from rest_framework.urlpatterns import format_suffix_patterns from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required from django.urls import re_path from django.views.generic import TemplateView from api.users import views from polyaxon.settings import registration if registration.REGISTRATION_WORKFLOW == registration.REGISTRATION_SUPERUSER_VALIDATION_WORKFLOW: urlpatterns = [ re_path( r'^register/?$', views.SimpleRegistrationView.as_view(), name='registration_simple_register'), re_path( r'^register/complete/?$', TemplateView.as_view(template_name='users/registration_simple_complete.html'), name='registration_complete'), re_path( r'^login/$', views.LoginView.as_view(template_name='users/login.html'), name='login'), re_path( r'^logout/$', views.LogoutView.as_view(), name='logout'), ] else: urlpatterns = [
from django.urls import re_path from . import views app_name = "music" urlpatterns = [ re_path(r'^$', views.IndexView.as_view(), name="index"), re_path(r'^register/$', views.UserFormView.as_view(), name="register"), re_path(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name="detail"), re_path(r'album/add/$', views.AlbumCreate.as_view(), name="album-add"), re_path(r'^(?P<pk>[0-9]+)/$', views.AlbumUpdate.as_view(), name="album-update"), re_path(r'^(?P<pk>[0-9]+)/delete/$', views.AlbumDelete.as_view(), name="album-delete"), ]
"""Smyt blog site URL Configuration.""" from django.contrib import admin from django.urls import path, include, re_path from django.conf import settings from django.conf.urls.static import static import apps.blog.urls urlpatterns = [ path('{}admin/'.format(settings.BASE_NAME), admin.site.urls), re_path(r'^{}ckeditor/'.format(settings.BASE_NAME), include('ckeditor_uploader.urls')), path('{}'.format(settings.BASE_NAME), include(apps.blog.urls, namespace='blog')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""untitled6 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.conf.urls import url from django.contrib import admin from django.urls import path, re_path from app1 import views urlpatterns = [ re_path(r'home/', views.home), re_path(r'db_handle/', views.db_handle), re_path(r'host_page/', views.host_page), re_path(r'page2', views.page2), ]
return HttpResponse(template.render(request=request)) @never_cache def show_template_response(request): template = engines['django'].from_string(TEMPLATE) return TemplateResponse(request, template) class ContactForm(forms.Form): name = forms.CharField(required=True) slug = forms.SlugField(required=True) class ContactFormViewWithMsg(SuccessMessageMixin, FormView): form_class = ContactForm success_url = show success_message = "%(name)s was created successfully" urlpatterns = [ re_path('^add/(debug|info|success|warning|error)/$', add, name='add_message'), path('add/msg/', ContactFormViewWithMsg.as_view(), name='add_success_msg'), path('show/', show, name='show_message'), re_path( '^template_response/add/(debug|info|success|warning|error)/$', add_template_response, name='add_template_response', ), path('template_response/show/', show_template_response, name='show_template_response'), ]
if settings.DEBUG: # This allows the error pages to be debugged during development, just visit # these url in browser to see how these error pages look like. urlpatterns += [ path( "400/", default_views.bad_request, kwargs={"exception": Exception("Bad Request!")}, ), path( "403/", default_views.permission_denied, kwargs={"exception": Exception("Permission Denied")}, ), path( "404/", default_views.page_not_found, kwargs={"exception": Exception("Page not Found")}, ), path("500/", default_views.server_error), ] if "debug_toolbar" in settings.INSTALLED_APPS: import debug_toolbar urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns urlpatterns += [ re_path(r"^(?P<path>.*)/$", TemplateView.as_view(template_name="build/index.html")), path("", TemplateView.as_view(template_name="build/index.html"), name="home"), ]
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, re_path from django.views.generic import TemplateView, RedirectView from django.conf import settings from django.contrib.staticfiles.views import serve from rest_framework_jwt.views import obtain_jwt_token import os urlpatterns = [ path(r'admin/', admin.site.urls), # /vpmoapp is now linked to vpmotree as opposed to vpmoapp - vpmoapp to be deleted on vpmotree deployment path(r'vpmoapp/', include('vpmotree.urls')), path(r'vpmoauth/', include("vpmoauth.urls")), path(r"vpmodoc/", include("vpmodoc.urls")), # Paths to allow serving the template + static files from ng's build folder path(r"", serve, kwargs={'path': 'index.html'}), re_path(r'^(?!/?static/)(?!/?media/)(?P<path>.*\..*)$', RedirectView.as_view(url='/static/%(path)s', permanent=False)) ]
"""This contains all of the WebSocket routes used by the Reporting application.""" # Django Imports from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path(r"ws/reports/(?P<report_id>\w+)/$", consumers.ReportConsumer.as_asgi()), ]
from django.contrib import admin from django.urls import include, re_path from django.views.generic import RedirectView urlpatterns = ( re_path(r'^$', RedirectView.as_view(url='/api')), re_path(r'^admin/', admin.site.urls), re_path( 'api/', include('project.apps.motius.api.urls', namespace='motius') ), )
from django.urls import path, re_path from .schema import SchemaView urlpatterns = [ # Documentation Routes # - - - - - - - - - - - - - re_path(r'^swagger(?P<format>\.json|\.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'), path('swagger/', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), path('redoc/', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'), path('', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]