def make_urls(url_fragment, list_view, detail_view, namespace): """Register list and detail view for each type of content.""" return path(url_fragment, include(( [path('', list_view.as_view(), name='list'), path('<slug:slug>/', detail_view.as_view(), name='detail')], 'consulting'), namespace=namespace))
def test_invalid_routes(): """ Test URLRouter route validation """ try: from django.urls import include except ImportError: # Django 1.11 from django.conf.urls import include with pytest.raises(ImproperlyConfigured) as exc: URLRouter([url(r"^$", include([]))]) assert "include() is not supported in URLRouter." in str(exc)
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 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
"""myshop 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 django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('', include('shop.urls', namespace='shop')), path('cart/', include('cart.urls', namespace='cart')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import include from django.urls import path from rest_framework.routers import DefaultRouter from apps.api.impl.v1.views import PhotoViewSet from apps.api.impl.v1.views import UserViewSet router = DefaultRouter() router.register("user", UserViewSet, "user") router.register("photo", PhotoViewSet, "photo") urlpatterns = [ path("", include(router.urls), name="r"), ]
"""travel 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 urlpatterns = [ path('admin/', admin.site.urls), path('', include('tourit.urls')), ]
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.conf.urls.static import static from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('', include('market.urls')), path('cart/', include('cart.urls')), path('mynotes/', include('mynotes.urls')), path('settings/', include('settings.urls')), path('checkout/', include ('checkout.urls')), #path('account/', include('account.urls')), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) if not settings.DEBUG:
from django.urls import include, path from django.contrib import admin from filebrowser.sites import site admin.autodiscover() urlpatterns = [ path('admin/filebrowser/', site.urls), path('grappelli/', include('grappelli.urls')), path('admin/', admin.site.urls), ]
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> from django.urls import include, path from django.views.generic.base import RedirectView from . import views # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = [ # Examples: # url(r'^$', 'sdaps_web.views.home', name='home'), # url(r'^sdaps_web/', include('sdaps_web.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: path('admin/', admin.site.urls), path('', include(views)), path('', RedirectView.as_view(url='/surveys')), path('surveys/', include('sdaps_ctl.urls')), ]
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,include) urlpatterns = [ #admin loagin page path('admin/', admin.site.urls), #home page path('',include('learning_logs.learn_urls')), #user page path('users/',include('users.users_urls')), ]
from django.conf import settings from django.conf.urls.static import static from blog import views as user_views urlpatterns = [ path('admin/', admin.site.urls), path('register/', user_views.register, name='register'), path('profile/', user_views.profile, name='profile'), path('login/', auth_views.LoginView.as_view(template_name='blog/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='blog/logout.html'), name='logout'), path('like/', user_views.like_post, name='like_post'), path('', include('blog.urls')), path('password-reset/', auth_views.PasswordResetView.as_view( template_name='blog/password_reset.html'), name='password_reset'), path('password-reset/done/', auth_views.PasswordResetDoneView.as_view( template_name='blog/password_reset_done.html'), name='password_reset_done'), path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view( template_name='blog/password_reset_confirm.html'), name='password_reset_confirm'), path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view( template_name='blog/password_reset_complete.html'),
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.contrib.sitemaps.views import sitemap from blog.sitemaps import PostSitemap from django.conf import settings from django.conf.urls.static import static sitemaps = { 'posts' : PostSitemap, } urlpatterns = [ path('admin/', admin.site.urls), path('blog/', include('blog.urls')), path('references/', include('references.urls')), path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'), path('account/', include('account.urls')), path('api/', include('blog.api.urls', namespace='api')), path('apiref/', include('references.api.urls', namespace='api')), path('api_auth/', include('rest_framework.urls')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""tomorrow_headline 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 include, path urlpatterns = [ path('admin/', admin.site.urls), path('', include('news.urls')), ]
router = routers.DefaultRouter() router.register(r'department', tutorviews.DepartmentViewSet) router.register(r'subject', tutorviews.SubjectViewSet) router.register(r'schedule', tutorviews.ScheduleViewSet) router.register(r'tutor', tutorviews.TutorViewSet) router.register(r'student', tutorviews.StudentViewSet) router.register(r'job', jobviews.JobViewSet) router.register(r'alumni', accountviews.AlumniViewSet) router.register(r'board', boardviews.BoardViewSet) router.register(r'topic', boardviews.TopicViewSet) router.register(r'post', boardviews.PostViewSet) urlpatterns = [ path('admin/', admin.site.urls), # View for decoding received JWTs path('token-auth/', obtain_jwt_token), # URL redirection for Django apps path('accounts/', include('accounts.urls')), path('api/', include(router.urls)), path('api/job/<int:pk>/update/', jobviews.JobUpdateView.as_view()), path('api/job/<int:pk>/retrieve/', jobviews.JobRetrieveView.as_view(), name="job_details"), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), ]
"""expemanager 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 urlpatterns = [ path('admin/', admin.site.urls), path('', include('tracker.urls')), path('', include('accounts.urls')) ] urlpatterns += [ path('accounts/', include('django.contrib.auth.urls')), path('auth/', include('social_django.urls', namespace='social')), ]
"""icekraft 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 urlpatterns = [ path('admin/', admin.site.urls), path('api/',include('apis.urls')), path('order_management/', include('order_management.urls')), ]
"""regp 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 regapp import urls urlpatterns = [ path('admin/', admin.site.urls), path('',include('regapp.urls')) ]
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.conf.urls.static import static from django.conf import settings from . import views urlpatterns = [ # Index path('', include('home.urls')), path('about', views.about, name='about'), # Blog path('blog/', include('blog.urls')), # Contact path('contact/', include('contact.urls')), # Login/register path('account/', include('account.urls')), path('account/', include('django.contrib.auth.urls')), # Admin panel path('admin/', admin.site.urls), ]
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 allauth.account.views import confirm_email from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi urlpatterns = [ path("", include("home.urls")), path("accounts/", include("allauth.urls")), path("api/v1/", include("home.api.v1.urls")), path("admin/", admin.site.urls), path("users/", include("users.urls", namespace="users")), path("rest-auth/", include("rest_auth.urls")), # Override email confirm to use allauth's HTML view instead of rest_auth's API view path("rest-auth/registration/account-confirm-email/<str:key>/", confirm_email), path("rest-auth/registration/", include("rest_auth.registration.urls")), ] admin.site.site_header = "Advisory 2" admin.site.site_title = "Advisory 2 Admin Portal" admin.site.index_title = "Advisory 2 Admin" # swagger
"""common 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 include, path, re_path urlpatterns = [ path('admin/', admin.site.urls), path('', include('hello.urls')) ]
"""weather_app 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 urlpatterns = [ path('admin/', admin.site.urls), path('', include('apps.weather.urls')), ]
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('users.urls')), path('users/', include('django.contrib.auth.urls')), path('articles/', include('articles.urls')), path('', include('pages.urls')), ]
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('uchet.urls')), path('accounts/', include('accounts.urls')), ]
router = DefaultRouter() router.register('one-to-one/places/alchemy', o2o_api.SQLAlchemyPlaceViewSet, 'one-to-one-alchemy|place') router.register('one-to-one/places/plain', o2o_api.PlainPlaceViewSet, 'one-to-one-plain|place') router.register('one-to-one/places', o2o_api.PlaceViewSet, 'one-to-one|place') router.register('one-to-one/restaurants/alchemy', o2o_api.SQLAlchemyRestaurantViewSet, 'one-to-one-alchemy|restaurant') router.register('one-to-one/restaurants', o2o_api.RestaurantViewSet, 'one-to-one|restaurant') router.register('one-to-one/waiters/alchemy', o2o_api.SQLAlchemyWaiterViewSet, 'one-to-one-alchemy|waiter') router.register('one-to-one/waiters', o2o_api.WaiterViewSet, 'one-to-one|waiter') router.register('many-to-one/reporters/alchemy', m2o_api.SQLAlchemyReporterViewSet, 'many-to-one-alchemy|reporter') router.register('many-to-one/reporters', m2o_api.ReporterViewSet, 'many-to-one|reporter') router.register('many-to-one/articles/alchemy', m2o_api.SQLAlchemyArticleViewSet, 'many-to-one-alchemy|article') router.register('many-to-one/articles', m2o_api.ArticleViewSet, 'many-to-one|article') router.register('many-to-many/publications/alchemy', m2m_api.SQLAlchemyPublicationViewSet, 'many-to-many-alchemy|publication') router.register('many-to-many/publications', m2m_api.PublicationViewSet, 'many-to-many|publication') router.register('many-to-many/articles/alchemy', m2m_api.SQLAlchemyArticleViewSet, 'many-to-many-alchemy|article') router.register('many-to-many/articles', m2m_api.ArticleViewSet, 'many-to-many|article') router.register('generic/a', g_api.ModelAViewSet, 'generic|a') router.register('generic/b', g_api.ModelBViewSet, 'generic|b') urlpatterns = router.urls if settings.DEBUG: urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), ]
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, include from django.contrib.auth.views import PasswordResetView, LogoutView from server.views import LoginView from server.urls import router urlpatterns = [ path('', include('server.urls')), path('admin/', admin.site.urls), path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('password_reset/', PasswordResetView.as_view(), name='password_reset'), path('api-auth/', include('rest_framework.urls')), path('api/', include(router.urls)), ]
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)) ]
from django.urls import include, path from rest_framework import routers from rest_framework_jwt.views import obtain_jwt_token from api.views.users import UserViewSet, GroupViewSet from api.views.arguments import ArgumentViewSet from api.views.bigpictures import BigPictureViewSet router = routers.DefaultRouter() router.register(r'users', UserViewSet) router.register(r'groups', GroupViewSet) router.register(r'arguments', ArgumentViewSet) router.register(r'bigpictures', BigPictureViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ path('api/token-auth/', obtain_jwt_token), path('api/', include(router.urls)), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) ]
"""comocomo 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 include, path, re_path from rest_framework import routers from gathering import views as gathering_views from barns import views as barns_views urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', include('rest_auth.urls')), path('api/v1/food-kinds/', gathering_views.FoodKindViewSet.as_view({'get': 'list'}), name='food-kinds'), path('api/v1/food-kinds/<kind_id>/food-types/', gathering_views.FoodTypeViewSet.as_view({'get': 'list'}), name='food-types'), path('api/v1/food-registrations/', gathering_views.FoodRegistrationView.as_view(), name='food-registrations'), path('api/v1/week-statistics/<from_date>/<to_date>/', barns_views.WeekStatisticsView.as_view(), name='week-statistics'), ]
from django.conf import settings from django.contrib import admin from django.urls import include, path, re_path from django.views.generic import TemplateView from tango_shared.views import build_howto admin.autodiscover() urlpatterns = [ path('', TemplateView, {'template_name': 'index.html'}, name='home'), 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.
"""django_pro 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, include from django.conf . urls import url urlpatterns = [ url ( r'^app1/', include ('app1.urls')), path('admin/', admin.site.urls), ]
from django.urls import path, include from rest_framework import routers from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token from yaapi.views import BaseAPIView, APIRootView # from yacommon import views as yacommon_view from yaapi.views.blog import BlogPostAPIView, BlogPostListAPIView, BlogCategoryAPIView, BlogTagsAPIView, \ BlogPostArchiveAPIView from yaapi.views.search import BlogSearchAPIView router = routers.DefaultRouter() urlpatterns = [ path(r'v1/auth/api-auth', include('rest_framework.urls', namespace='rest_framework')), path(r'v1/auth/api-token-auth', obtain_jwt_token), path(r'v1/auth/api-token-refresh', refresh_jwt_token), path(r'v1/auth/api-token-verify', verify_jwt_token), path(r'v1/blog-post/<str:title>', BlogPostAPIView.as_view()), path(r'v1/blog-posts', BlogPostListAPIView.as_view()), path(r'v1/blog-posts/search', BlogSearchAPIView.as_view()), path(r'v1/archive', BlogPostArchiveAPIView.as_view()), path(r'v1/category', BlogCategoryAPIView.as_view()), path(r'v1/tags', BlogTagsAPIView.as_view()), # url(r'system/info', yacommon_view.SystemInfo.as_view(), name='system_info'), # url(r'blog/resume', yacommon_view.ResumeInfo.as_view(), name='resume_info'), path(r"^", include(router.urls)), ] if settings.DEBUG:
"""backend URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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 urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('spotify/', include('spotify.urls')) ]
router = DefaultRouter() api_root_view = router.get_api_root_view() api_root_view.cls.__name__ = "Contratos de Puerto Rico" api_root_view.cls.__doc__ = "" router.register(r"contracts", ContractViewSet) router.register(r"documents", DocumentViewSet) router.register(r"contractors", ContractorViewSet) router.register(r"entities", EntityViewSet) router.register(r"service-groups", ServiceGroupViewSet) router.register(r"services", ServiceViewSet) router.register(r"collection-jobs", CollectionJobViewSet) urlpatterns = [ path("v1/", include((router.urls, "api"), namespace="v1")), path("v1/pages/home/", HomePageView.as_view()), path("v1/pages/trends/general/", TrendsGeneralView.as_view()), path("v1/pages/trends/services/", TrendsServicesView.as_view()), path( "v1/docs/schema.json", get_schema_view(title="Contratos de Puerto Rico"), name="openapi-schema", ), path( "v1/docs/", TemplateView.as_view( template_name="swagger-ui.html", extra_context={"schema_url": "openapi-schema"}, ), name="swagger-ui",
from django.urls import include, path from django.contrib import admin from rest_framework import routers from invitations import views router = routers.SimpleRouter() router.register(r'events', views.EventViewSet) router.register(r'rsvps', views.RsvpViewSet) urlpatterns = [ path('admin/', admin.site.urls), path('api-auth/', include(('rest_framework.urls', 'rest_framework'), namespace='rest_framework')), path('api/v1/invitations/', include(('invitations.urls', 'invitations'), namespace='invitations')), path('api/v2/', include((router.urls, 'router'), namespace='apiv2')), ]
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import (HelloApiView, HelloViewSet, UserProfileViewSet, UserLoginApiView, UserProfileFeedViewSet) router = DefaultRouter() router.register('hello-viewset', HelloViewSet, base_name='hello-viewset') router.register('profile', UserProfileViewSet) router.register('feed', UserProfileFeedViewSet) urlpatterns = [ path('hello-view/', HelloApiView.as_view()), path('login/', UserLoginApiView.as_view()), path('', include(router.urls)), ]
"""simpledemobetterforms 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 urlpatterns = [ path('', include('apps.catalogos.urls')), path('admin/', admin.site.urls), ]
"""sites 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 urlpatterns = [ path('admin/', admin.site.urls), path('report/', include('report.urls')), path('dashboard/', include('dashboard.urls')), path('attendance/', include('attendance.urls')) ]
import os import django from django.conf import settings from django.conf.urls import url from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() urlpatterns = [url(r'^admin/', admin.site.urls)] + static( settings.STATIC_URL, document_root=settings.STATIC_ROOT ) IS_DJANGO_20 = django.VERSION >= (2,) if os.getenv('TEST_WITH_DEBUGTOOLBAR', False) == 'on': if IS_DJANGO_20: import debug_toolbar from django.urls import include, path urlpatterns += [path('__debug__/', include(debug_toolbar.urls))] else: import debug_toolbar from django.conf.urls import include, url urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
"""cabAd 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 constants import uri_constants urlpatterns = [ path(uri_constants.ADMIN_URI, admin.site.urls), path(uri_constants.MAIN_URI, include('main.url')) ]
"""ghini URL Configuration """ from django.contrib import admin from django.urls import path, include from django.views.generic.base import RedirectView from django.contrib.auth.views import LoginView, LogoutView favicon_view = RedirectView.as_view(url='/static/favicon.ico', permanent=True) root_view = RedirectView.as_view(url='/browse/', permanent=True) urlpatterns = [ # admin path('admin/', admin.site.urls), path('accounts/login/', LoginView.as_view(), name='login'), path('accounts/logout/', LogoutView.as_view(next_page='/'), name='logout'), # include path('taxonomy/', include('taxonomy.urls')), path('collection/', include('collection.urls')), path('garden/', include('garden.urls')), path('browse/', include('browse.urls')), path('select2/', include('django_select2.urls')), # root redirect views path("favicon.ico", favicon_view, name='favicon'), path('', root_view, name='home'), ]
"""BlogBreakout 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 urlpatterns = [ path('', include("BlogApp.urls")), # path('admin/', admin.site.urls), ]
"""bravesWeb 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 include from django.urls import path urlpatterns = [ path('', include('batData.urls')), path('admin/', admin.site.urls), ]
openapi.Info( title="reCommendme API", default_version='v1', description=''' ### Сервис доставки продуктов [**Swagger**](/swagger/) [**ReDoc**](/redoc/) ''', contact=openapi.Contact(email="*****@*****.**"), ), public=True, permission_classes=(permissions.AllowAny,), ) urlpatterns = [ path('', index), re_path(r'^catalog.*', index), re_path(r'^basket.*', index), re_path(r'^profile.*', index), re_path(r'^order.*', index), path('v1/', include([ path('market/', include('market.urls')), ])), ] urlpatterns += [ path('admin/', admin.site.urls), path('swagger/', schema_view.with_ui('swagger', cache_timeout=None), name='schema-swagger-ui'), path('redoc/', schema_view.with_ui('redoc', cache_timeout=None), name='schema-redoc') ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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.conf.urls import url from django.conf import settings from django.conf.urls.static import static from rest_framework.schemas import get_schema_view schema_view = get_schema_view(title='Allobouffe API') urlpatterns = [ path('admin/', admin.site.urls), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^schema/$', schema_view), url(r'^', include('allobouffe.urls')), ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""car_api URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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 include, path from api import urls urlpatterns = [ path('admin/', admin.site.urls), path('', include('api.urls')), ]
from rest_framework import routers from fiubar.api import views router = routers.DefaultRouter() router.register(r'alumnos/plancarreras', views.AlumnoViewSet) router.register(r'alumnos/materias', views.AlumnoMateriaViewSet) router.register(r'facultad/carreras', views.CarreraViewSet) router.register(r'facultad/correlativas', views.CorrelativaViewSet) router.register(r'facultad/departamentos', views.DepartamentoViewSet) router.register(r'facultad/materias', views.MateriaViewSet) router.register(r'facultad/plancarreras', views.PlanCarreraViewSet) router.register(r'facultad/planmaterias', views.PlanMateriaViewSet) urlpatterns = [ path(r'', include(router.urls)), path(r'facultad/carreras/<str:pk>/plancarreras/', views.CarreraViewSet.get_plancarreras, name='carrera-plancarreras'), path(r'facultad/plancarreras/<str:pk>/planmaterias/', views.PlanCarreraViewSet.get_planmaterias, name='plancarrera-planmaterias'), path(r'auth/', include('rest_framework.urls', namespace='rest_framework')) ]
from django.contrib import admin from django.urls import path,include from django.conf.urls.static urlpatterns = [ path('admin/', admin.site.urls), path('', include('index.urls')), path('student/',include('student.urls')), ]
from __future__ import unicode_literals from django.urls import path, include from django.views.generic import TemplateView from . import views, always_allow_views urlpatterns = ( path('invited-only/', views.invited_only, name='invited_only'), path('always-allow/', views.always_allow, name='always_allow'), path('always-allow-module/', always_allow_views.allowed, name='always_allow_module'), path('not-allowed/', views.rejection, name='rejection'), path('hunger/', include('django_hunger2.urls')), path('accounts/', include('django.contrib.auth.urls')), path('accounts/profile/', TemplateView.as_view(template_name='profile.html'), name='profile'), )
"""Defines URL patterns for the main body of the app""" from django.urls import path, include from . import views app_name = 'main' urlpatterns = [ #Include default auth urls path('', include('django.contrib.auth.urls')), #Home page path('', views.index, name='index'), #Registration page path('register/', views.register, name='register'), ]
from django.urls import include, path, register_converter from . import converters, views register_converter(converters.Base64Converter, 'base64') subsubpatterns = [ path('<base64:last_value>/', views.empty_view, name='subsubpattern-base64'), ] subpatterns = [ path('<base64:value>/', views.empty_view, name='subpattern-base64'), path( '<base64:value>/', include((subsubpatterns, 'second-layer-namespaced-base64'), 'instance-ns-base64') ), ] urlpatterns = [ path('base64/<base64:value>/', views.empty_view, name='base64'), path('base64/<base64:base>/subpatterns/', include(subpatterns)), path('base64/<base64:base>/namespaced/', include((subpatterns, 'namespaced-base64'))), ]
"""rage 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.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include #from django.views.generic import TemplateView urlpatterns = [ path('admin/', admin.site.urls), #path('', TemplateView.as_view(template_name="index.html")), path('', include('onepage.urls')) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf import settings from django.urls import include, path from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from rest_framework_jwt.views import obtain_jwt_token from Marcus import views urlpatterns = [ path("rest-auth/", include('rest_auth.urls')), path("rest-auth/registration/", include('rest_auth.registration.urls')), # Django Admin, use {% url 'admin:index' %} path(settings.ADMIN_URL, admin.site.urls), # User management path( "users/", include("Marcus.users.urls", namespace="users"), ), path( "images/", include("Marcus.images.urls", namespace="images"), ), path( "notifications/", include("Marcus.notifications.urls", namespace="notifications"), ), path("accounts/", include("allauth.urls")),
from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, include from users import views from users import views as user_views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('register/', user_views.register, name='register'), path('profile/', user_views.profile, name='profile'), path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='users/logout.html'), name='logout'), path('', include('insta.urls')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""mysite 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 include, path urlpatterns = [ path('', include('polls.urls')), path('admin/', admin.site.urls), ]
"""StudentMailBenifits URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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 .home_view import home_view urlpatterns = [ path('admin/', admin.site.urls), path("api/", include("benefits.api_urls")), path("benefits/", include("benefits.web_urls")), path("users/", include("users.urls")), path("", home_view) ]
from django.contrib import admin from django.urls import include, path from django.views.generic.base import RedirectView urlpatterns = [ path("", RedirectView.as_view(url="/pages/ahernp-com"), name="homepage"), path("admin/", admin.site.urls), path("api/v1/", include("api.v1.urls")), path("blog/", include("blog.urls")), path("dashboard/", include("dashboard.urls")), path("feedreader/", include("feedreader.urls")), path("pages/", include("mpages.urls")), path("core/", include("core.urls")), path("timers/", include("timers.urls")), path("tools/", include("tools.urls")), ]
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 include, path from userdata.views import * from django.contrib.auth import views as auth_views from blog.views import * from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('blog/', include('blog.urls')), path('admin/', admin.site.urls), path('signup/', signup, name='signup'), path('login/', logIn, name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'), path('password_reset/', auth_views.PasswordResetView.as_view(template_name='password_reset.html'), name='password_reset'), path('password_reset_confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html', ), name='password_reset_confirm'), path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'), name='password_reset_done'), path('password_reset_complete/', auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html', ), name='password_reset_complete'), path('profile/', profile, name='profile'), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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.contrib import admin from django.urls import path, include urlpatterns = [ path('', include("core.urls")), path('admin/', admin.site.urls), path('accounts/', include('django.contrib.auth.urls')), ]