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.static import static from django.contrib import admin from django.urls.conf import path from jivan_jyoti_app import views from jivan_jyoti import settings urlpatterns = [ path('admin/', admin.site.urls), path('registration_form/', views.registration_form, name='registration_form'), path('admin_registration/', views.admin_registration, name='admin_registration'), path('volunteer_registration/', views.volunteer_registration, name='volunteer_registration'), path('fatch_ragistration_data/', views.fatch_ragistration_data), path('fatch_volunteer_data/', views.fatch_volunteer_data), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL,
from accountapp.views import hello_world from django.urls.conf import include, path app_name = "accountapp" urlpatterns = [ path('hello_world/', hello_world, name='hello_world') ]
except Exception as e: return JsonResponse( {"message": "An unexpected error happened: " + str(e)}, status=500) @require_http_methods(["GET"]) def by_searchterm(request, searchTerm): try: artists = Artist.objects.values( "id", "displayname", "description", "avatarUrl").filter( Q(displayname__icontains=searchTerm) | Q(description__icontains=searchTerm)) return JsonResponse(list(artists), safe=False) except Artist.DoesNotExist: return JsonResponse({"message": "The specified artist does not exist"}, status=404) except Exception as e: return JsonResponse( {"message": "An unexpected error happened: " + str(e)}, status=500) urlpatterns = [ path("artists/", index, name="create, update or read artists"), path("artists/avatar", set_avatar, name="set avatar"), path("artists/<int:artistId>", read_artist, name="read artist"), path("artists/search/<searchTerm>", by_searchterm, name="search for artist"), ]
from django.db import router from django.urls.conf import path from rest_framework import urlpatterns from rest_framework.routers import DefaultRouter from django.urls import path, include from .views import UserViewSet router = DefaultRouter() router.register('signup', UserViewSet) urlpatterns=[ path('',include(router.urls)) ]
"""RecordStream 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.urls.conf import path from .views import getListener, addListener, delListener, startListener, stopListener urlpatterns = [ path('get', getListener), path('add', addListener), path('delete', delListener), path('start', startListener), path('stop', stopListener) ]
from django.contrib import admin from django.urls.conf import path urlpatterns = [path(r"admin/", admin.site.urls)]
from django.urls.conf import path from django.views.generic.base import RedirectView from .admin_site import edc_appointment_admin from .views import UnscheduledAppointmentView app_name = 'edc_appointment' urlpatterns = [ path('unscheduled_appointment/<subject_identifier>/<visit_schedule_name>' '/<schedule_name>/<visit_code>/<redirect_url>/', UnscheduledAppointmentView.as_view(), name='unscheduled_appointment_url'), path('admin/', edc_appointment_admin.urls), path('', RedirectView.as_view(url='admin/edc_appointment/'), name='home_url'), ]
# -*- encoding: utf-8 -*- ''' Created on Apr 22, 2015 @author: bartacruz ''' from django.urls.conf import path from fgserver.tracker import views urlpatterns = [ path ('',views.home), path('callsign/<callsign>',views.callsign, name="callsign"), ]
from django.conf.urls import url from django.urls.conf import path from . import views urlpatterns = ( url(r'^$', views.RatingsView.as_view()), path('<event>', views.EventRatings.as_view()), path('<id>', views.RatingView.as_view()), )
from django.conf import settings from django.conf.urls import url from django.contrib import admin app_name = "edc_model" urlpatterns = [url(r"^admin/", admin.site.urls)] if settings.APP_NAME == app_name: from django.urls.conf import path from .admin import edc_model_admin urlpatterns += [path("admin/", edc_model_admin.urls)]
from django.urls.conf import path from django.views.generic import RedirectView app_name = "meta_subject" urlpatterns = [ path("", RedirectView.as_view(url="/meta_subject_admin/"), name="home_url"), ]
from meta_prn.admin_site import meta_prn_admin from django.contrib import admin from django.urls.conf import path, include urlpatterns = [ path("meta_prn/", include("meta_prn.urls")), path("admin/", meta_prn_admin.urls), path("admin/", admin.site.urls), ]
from django.urls.conf import path from django.views.generic.base import RedirectView from .admin_site import inte_prn_admin app_name = "inte_prn" urlpatterns = [ path("admin/", inte_prn_admin.urls), path("", RedirectView.as_view(url=f"/{app_name}/admin/"), name="home_url"), ]
from django.conf import settings from django.urls.conf import path, include from edc_base.views import AdministrationView from edc_device.views import HomeView app_name = 'edc_device' if settings.APP_NAME == 'edc_device': urlpatterns = [ path('accounts/', include('edc_base.auth.urls')), path('edc_base/', include('edc_base.urls')), path('administration/', AdministrationView.as_view(), name='administration_url')] else: urlpatterns = [] urlpatterns += [ path(r'', HomeView.as_view(), name='home_url'), ]
from django.contrib import admin from django.urls.conf import path urlpatterns = [ path("admin/", admin.site.urls), ]
from django.contrib import admin from django.urls.conf import path from django.views.generic.base import RedirectView app_name = "ambition_rando" urlpatterns = [ path("admin/", admin.site.urls), path("", RedirectView.as_view(url="/ambition_rando/admin/"), name="home_url"), ]
from django.urls.conf import path from django.views.generic.base import RedirectView from .admin_site import edc_metadata_admin app_name = 'edc_metadata' urlpatterns = [ path('admin/', edc_metadata_admin.urls), path('', RedirectView.as_view(url='admin/edc_metadata/'), name='home_url'), ]
"BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": "", } } STUB_DISCORD = env.bool("STUB_DISCORD", True) # WhiteNoise # ------------------------------------------------------------------------------ # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa ENV_SPECIFIC_URLS = [ path("__debug__/", include(debug_toolbar.urls)), ] if STUB_DISCORD: ENV_SPECIFIC_URLS.append( path("stub_discord_auth/", include("stub_discord_auth.urls")), ) INSTALLED_APPS.append("goosetools.stub_discord_auth.apps.StubDiscordAuthConfig") # django-debug-toolbar # ------------------------------------------------------------------------------ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites INSTALLED_APPS += ["debug_toolbar"] # noqa F405 # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405 # https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
from django.views.generic.base import RedirectView from django.urls.conf import path from .admin_site import edc_registration_admin app_name = 'edc_registration' urlpatterns = [ path('admin/', edc_registration_admin.urls), path('', RedirectView.as_view(url='admin/edc_registration/'), name='home_url'), ]
''' Created on 2019. 7. 28. @author: 405-19 ''' #하위 urls.py를 정의 및 해당 어플리케이션의 뷰함수를 등록 #app_name: 별칭기반으로 url을 찾을 때 사용하는 그룹 이름 #ex) cl 그룹명에 signup 별칭을 가진 뷰함수를 찾을 경우 #url 'cl:signup' from django.urls.conf import path from customlogin.views import signup, signin, signout app_name = 'cl' #urlpatterns: path함수로 뷰함수를 등록 및 관리하는 변수 urlpatterns = [ path('signup/', signup, name='signup'), path('signin/', signin, name='signin'), path('signout/', signout, name='signout'), ]
from django.conf import settings from django.contrib import admin from django.urls.conf import path from .views import ListboardView app_name = 'edc_dashboard' urlpatterns = [ path('admin/', admin.site.urls), ] if settings.APP_NAME == 'edc_dashboard': from .url_config import UrlConfig from .tests.admin import edc_dashboard_admin subject_listboard_url_config = UrlConfig( url_name='listboard_url', view_class=ListboardView, label='subject_listboard', identifier_label='subject_identifier', identifier_pattern='/w+') urlpatterns += subject_listboard_url_config.listboard_urls + [ path('admin/', edc_dashboard_admin.urls), ]
brand_image_1_path, brand_image_1_link = media.upload_to_s3(brand_image_1, 'uploads/outlets') wall_unit_1.medias.append(Media.objects.create(path=brand_image_1_path)) if brand_image_2: wall_unit_2 = wall_units[1] if len(wall_units) == 2 else None if wall_unit_2: brand_image_2_path, brand_image_2_link = media.upload_to_s3(brand_image_2, 'uploads/outlets') wall_unit_2.medias.append(Media.objects.create(path=brand_image_2_path)) outlet.save() response = {'status': 'SUCCESS'} else: response = {'status': 'FAIL', 'message': 'INVALID_USER'} return tools.ajax_response(response) def all_outlets(request): outlets = outlet_logi.get_all_outlets() response = {'status': 'SUCCESS', 'payload': list(map(lambda outlet: outlet_logi.outlet_dto(outlet), outlets))} return tools.ajax_response(response) urls = [ path('sync', sync), path('all', all_outlets) ]
from django.urls.conf import path from .views import * #app_name : 해당 파일에서 별칭으로 등록된 url들을 호출할 때 #app_name:별칭 으로 호출해 충돌이 생기지 않도록 설정 app_name = 'customlogin' #reverse('customlogin:signup') #{% url 'customlogin:signup' %} urlpatterns = [ path('signup/', signup, name='signup'), #127.0.0.1:8000/login/signin #customlogin:signin path('signin/', signin, name='signin'), path('logout/', auth_logout, name='logout') ]
from django.urls.conf import include, path from edc_dashboard.views import AdministrationView urlpatterns = [ path("accounts/", include("edc_auth.urls")), path("edc_adverse_event/", include("edc_adverse_event.urls")), path("edc_dashboard/", include("edc_dashboard.urls")), path("edc_export/", include("edc_export.urls")), path("edc_lab/", include("edc_lab.urls")), path("edc_lab_dashboard/", include("edc_lab_dashboard.urls")), path("edc_auth/", include("edc_auth.urls")), path("edc_pharmacy/", include("edc_pharmacy.urls")), path("edc_reference/", include("edc_reference.urls")), path("meta_ae/", include("meta_ae.urls")), path("meta_lists/", include("meta_lists.urls")), path("meta_prn/", include("meta_prn.urls")), path("edc_randomization/", include("edc_randomization.urls")), path("meta_screening/", include("meta_screening.urls")), path("meta_consent/", include("meta_consent.urls")), path("meta_subject/", include("meta_subject.urls")), path("administration/", AdministrationView.as_view(), name="administration_url"), ]
import os from django.conf import settings from django.contrib.auth import get_user_model from django.http.response import HttpResponse from django.test.utils import override_settings from django.urls.conf import path from djangae.test import TestCase User = get_user_model() urlpatterns = [path('', lambda request: HttpResponse('Ok'), name='index')] @override_settings(ROOT_URLCONF=__name__) class LocalIAPMiddlewareTests(TestCase): def setUp(self): super().setUp() settings.MIDDLEWARE.insert( settings.MIDDLEWARE.index( 'djangae.contrib.googleauth.middleware.AuthenticationMiddleware' ), 'djangae.contrib.googleauth.middleware.LocalIAPLoginMiddleware') def tearDown(self): super().tearDown() settings.MIDDLEWARE.remove( 'djangae.contrib.googleauth.middleware.LocalIAPLoginMiddleware') def test_login_view_displayed(self): response = self.client.get("/_dj/login/")
''' Created on Aug 23, 2020 @author: autonomous ''' from django.urls.conf import path from wooribank.loan import views urlpatterns = [ path('sale/', views.sale, name='sale'), path('new', views.new_loan, name='new_loan'), path('save', views.create_or_update, name='create_or_update'), ]
from django.contrib import admin from django.urls.conf import path from first_app import views urlpatterns = [ path('', views.index, name='index'), path('contactus', views.contactus, name='contact_us'), path('templates_example', views.templates_example), path('models_example', views.category_list) ]
queryset = User.objects.all() serializer_class = UserSerializer class JobSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Job fields = '__all__' class JobViewSet(viewsets.ModelViewSet): queryset = Job.objects.all() serializer_class = JobSerializer router = routers.DefaultRouter() router.register('users', UserViewSet) router.register('job_list', JobViewSet) urlpatterns = [ url(r"^$", views.job_list, name="job_list"), url(r"^job_list/", views.job_list, name="job_list"), url(r"^job/(?P<job_id>\d+)/$", views.job, name="job"), url(r'^resume/add/', views.ResumeCreateView.as_view(), name='resume_add'), path('resume/<int:pk>/', views.ResumeDitailView.as_view(), name='resume_detail'), path('api-auth/', include('rest_framework.urls')), path('api/', include(router.urls)), ]
from django.urls.conf import path from . import views urlpatterns = [ path('datasets', views.datasets, name='datasets'), # path('', include('pages.urls')), ]
"""ValueTracker 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.conf import path, include urlpatterns = [ path('admin/', admin.site.urls), path('track/', include('track.urls')), ]
from django.conf.urls import include from django.urls.conf import path from django.contrib import admin from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', include('dsmr_api.urls.v1')), path('api/v2/', include('dsmr_api.urls.v2')), path('', include('dsmr_frontend.urls')), ] if settings.DEBUG: import debug_toolbar # pragma: no cover urlpatterns += [ path('__debug__/', include(debug_toolbar.urls)), ] # pragma: no cover
from django.urls.conf import path from baseportal.views import HomePageView, LandRecordView app_name = 'baseportal' urlpatterns = [ path('', HomePageView.as_view(), name='homepage'), path('landrecord', LandRecordView.as_view(), name='landrecord') ]
from meta_consent.admin_site import meta_consent_admin from meta_prn.admin_site import meta_prn_admin from meta_screening.admin_site import meta_screening_admin from meta_subject.admin_site import meta_subject_admin from django.contrib import admin from django.views.generic.base import RedirectView from edc_action_item.admin_site import edc_action_item_admin from edc_consent.admin_site import edc_consent_admin from edc_dashboard.views import AdministrationView from edc_locator.admin_site import edc_locator_admin from edc_reference.admin_site import edc_reference_admin from .admin import meta_test_admin urlpatterns = [ path("accounts/", include("edc_auth.urls")), path("admin/", include("edc_auth.urls")), path("admin/", edc_appointment_admin.urls), path("admin/", edc_consent_admin.urls), path("admin/", meta_test_admin.urls), path("admin/", meta_ae_admin.urls), path("admin/", meta_prn_admin.urls), path("admin/", edc_reference_admin.urls), path("admin/", edc_locator_admin.urls), path("admin/", meta_consent_admin.urls), path("admin/", meta_subject_admin.urls), path("admin/", meta_screening_admin.urls), path("admin/", edc_action_item_admin.urls), path("admin/", admin.site.urls), path("administration/", AdministrationView.as_view(),
# chat/routing.py from django.urls.conf import path from . import consumers websocket_urlpatterns = [ path('ws/chat/<slug:user_id>/', consumers.ChatConsumer.as_asgi()), path('ws/chat/group/<slug:group_chat_id>/', consumers.GroupChatConsumer.as_asgi()), ]
from django.urls.conf import path from edc_base.views import HomeView app_name = 'edc_base' urlpatterns = [ path(r'', HomeView.as_view(), name='home_url'), ]
from django.urls.conf import include, path from django.views.generic.base import RedirectView urlpatterns = [ path("edc_auth/", include("edc_auth.urls")), path("edc_adverse_event/", include("edc_adverse_event.urls")), path("edc_randomization/", include("edc_randomization.urls")), path("edc_consent/", include("edc_consent.urls")), path("edc_dashboard/", include("edc_dashboard.urls")), path("edc_export/", include("edc_export.urls")), path("edc_device/", include("edc_device.urls")), path("edc_protocol/", include("edc_protocol.urls")), path("edc_reference/", include("edc_reference.urls")), path("edc_visit_schedule/", include("edc_visit_schedule.urls")), path("meta_consent/", include("meta_consent.urls")), path( "administration", RedirectView.as_view(url="admin/"), name="administration_url" ), path("", RedirectView.as_view(url="admin/"), name="home_url"), ]
from django.urls.conf import path from django.views.generic.base import RedirectView from .admin_site import encryption_admin app_name = "django_crypto_fields" urlpatterns = [ path("admin/", encryption_admin.urls), path("", RedirectView.as_view(url="admin/"), name="home_url"), ]
from django.contrib.auth import views as auth_views from django.urls.conf import path from simplemooc.accounts import views as accounts_views app_name = 'accounts' urlpatterns = [ path('', accounts_views.dashboard, name='dashboard'), path('entrar/', auth_views.login, {'template_name': 'accounts/login.html'}, name='login'), path('sair/', auth_views.logout, {'next_page': 'core:home'}, name='logout'), path('cadastre-se/', accounts_views.register, name='register'), path('nova-senha/', accounts_views.password_reset, name='password_reset'), path('confirmar-nova-senha/<key>/', accounts_views.password_reset_confirm, name='password_reset_confirm'), path('editar/', accounts_views.edit, name='edit'), path('editar-senha/', accounts_views.edit_password, name='edit_password'), ]
# -*- encoding: utf-8 -*- ''' Created on Apr 22, 2015 @author: bartacruz ''' from django.urls.conf import path from fgserver.map import views urlpatterns = [ path('', views.map_view, name='map_view'), path('', views.aircrafts, name='aircrafts'), path('', views.flightplan, name='flightplan'), ]
from django.urls.conf import path from cueeneh import views app_name = 'cueeneh' urlpatterns = [ path('', views.TodaysQuestionList.as_view(), name='index'), path('ask', views.AskQuestionView.as_view(), name='ask'), path('daily/<int:year>/<int:month>/<int:day>/', views.DailyQuestionList.as_view(), name='daily_questions'), path('q/<int:pk>', views.QuestionDetailView.as_view(), name='question_detail'), path('q/<int:pk>/answer', views.CreateAnswerView.as_view(), name='answer_question'), path('a/<int:pk>/accept', views.UpdateAnswerAcceptanceView.as_view(), name='update_answer_acceptance'), ]
from django.urls.conf import path, re_path from .admin_site import edc_visit_schedule_admin from .views import HomeView app_name = 'edc_visit_schedule' urlpatterns = [ path('admin/', edc_visit_schedule_admin.urls), re_path(r'(?P<visit_schedule>[0-9A-Za-z_]+)/' '(?P<schedule>^[0-9A-Za-z_]+$)/(?P<visit_code>^[0-9]+$)/', HomeView.as_view(), name='home_url'), re_path(r'(?P<visit_schedule>[0-9A-Za-z_]+)/(?P<schedule>^[0-9A-Za-z_]+$)/', HomeView.as_view(), name='home_url'), re_path(r'(?P<visit_schedule>[0-9A-Za-z_]+)/', HomeView.as_view(), name='home_url'), path(r'', HomeView.as_view(), name='home_url'), ]
from django.urls.conf import path from django.views.generic.base import RedirectView from .admin_site import edc_lab_admin app_name = 'edc_lab' urlpatterns = [ path('admin/', edc_lab_admin.urls), path('', RedirectView.as_view(url='admin/edc_lab/'), name='home_url'), ]