from django.urls import include, path from users.views import (GroupUpdateView, UserAddByListXlsxDownload, UserCreateView, UserDeactivateView, UserListView, UserRetrieveView, UserUpdateView, UserUploadXlsxView, balance_from_username, username_from_username_part) users_patterns = [ path( 'users/', include([ path('', UserListView.as_view(), name='url_user_list'), path('create/', UserCreateView.as_view(), name='url_user_create'), path( '<int:user_pk>/', include([ path('', UserRetrieveView.as_view(), name='url_user_retrieve'), path('update/', UserUpdateView.as_view(), name='url_user_update'), path('deactivate/', UserDeactivateView.as_view(), name='url_user_deactivate') ])), path('add_by_list/xlsx/', UserUploadXlsxView.as_view(), name='url_add_by_list_xlsx'), path('add_by_list/xlsx/download/', UserAddByListXlsxDownload.as_view(),
from se2015.views import IndexView from records.views import ExerciseRecordView, ExamRecordView from records.views import ExamRecordUserView from exercises.views import ExerciseView, SkillView, GradeView, ExamDetailView from exercises.views import ExamListView urlpatterns = [ url(r'^api/avatar/(?P<username>.+)/$', AvatarView.as_view()), url(r'^api/v1/exam_list/(?P<grade_id>.+)/$', ExamListView.as_view()), url(r'^api/v1/exam/(?P<exam_id>.+)/$', ExamDetailView.as_view()), url(r'^api/v1/exam_record_user/(?P<exam_id>.+)/$', ExamRecordUserView.as_view()), url(r'^api/v1/exam_record/(?P<exam_id>.+)/$', ExamRecordView.as_view()), url(r'^api/v1/exercise/(?P<grade_id>.+)/(?P<skill_id>.+)/$', ExerciseView.as_view()), url(r'^api/v1/exercise/(?P<grade_id>.+)/$', SkillView.as_view()), url(r'^api/v1/grades/$', GradeView.as_view()), url(r'^api/v1/accounts/records/(?P<username>.+)/$', ExerciseRecordView.as_view(), name='recordDetail'), url(r'^api/v1/accounts/(?P<username>.+)/$', UserDetailView.as_view(), name='detail'), url(r'^api/v1/accounts/', UserListView.as_view(), name='list'), url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'), url(r'^api/v1/auth/logout/$', LogoutView.as_view(), name='logout'), url(r'^admin/', include(admin.site.urls)), url('^.*$', IndexView.as_view(), name='index'), ]
from django.conf.urls import patterns, url, include from orgs.models import Organization from orgs.views import OrganizationDetailView, OrganizationListView, OrganizationMemberView from users.views import UserListView from oclapi.models import NAMESPACE_PATTERN, CONCEPT_ID_PATTERN __author__ = 'misternando' urlpatterns = patterns('', url(r'^$', OrganizationListView.as_view(), name='organization-list'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/$', OrganizationDetailView.as_view(), name='organization-detail'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/members/$', UserListView.as_view(), {'related_object_type': Organization, 'related_object_kwarg': 'org', 'related_object_attribute': 'members'}, name='organization-members'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/members/(?P<user>' + NAMESPACE_PATTERN + ')/$', OrganizationMemberView.as_view(), name='organization-member-detail'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/sources/', include('sources.urls')), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/collections/', include('collection.urls')), )
def test_includes_upload_form_mixin(self): # Expect the form to include upload form in hierarchy assert isinstance(UserListView(), UploadFormMixin)
# /users/:user/sources/:source/mappings/:mapping/edit/ url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/edit/$', # pylint: disable=C0301 MappingEditView.as_view(), name='mapping-edit'), # /users/:user/sources/:source/mappings/:mapping/retire/ url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/retire/$', # pylint: disable=C0301 MappingRetireView.as_view(), name='mapping-retire'), ## CORE USER - are these used at all? # URL pattern for the UserListView url(r'^$', UserListView.as_view(), name='list'), # URL pattern for the UserRedirectView url(r'^~redirect/$', UserRedirectView.as_view(), name='redirect'), # URL pattern for the UserDetailView url(r'^(?P<username>[\w@\.\+\-_]+)/$', UserDetailView.as_view(), name='detail'), # URL pattern for the UserUpdateView url(r'^update/(?P<username>[\w@\.\+\-_]+)/$', UserUpdateView.as_view(), name='update'),
from django.urls import path, include from rest_framework.authtoken.views import obtain_auth_token from users.views import UserListView, CurrentUserIdView, CurrentUserView, UserRegistrationView urlpatterns = [ path('login', obtain_auth_token, name='login'), path('createuser', UserRegistrationView.as_view(), name='create user'), path('userlist', UserListView.as_view(), name='userlist'), path('user/<int:id>', CurrentUserIdView.as_view(), name='user with id'), path('user', CurrentUserView.as_view(), name='Current User') ]
# api/urls.py from django.urls import include, path from users.views import UserListView, UserCreateView from rest_framework.authtoken import views urlpatterns = [ #path('users/', include('users.urls'), name='users-api'), path('users/', UserListView.as_view(), name='users-list-view'), path('users/create/', UserCreateView.as_view(), name='users-create-view'), path('rest-auth/', include('rest_auth.urls')), path('api-token-auth/', views.obtain_auth_token, name='api-auth-token'), ]
from django.conf.urls import patterns, url, include from orgs.views import OrganizationListView from users.models import UserProfile from users.views import UserListView, UserDetailView, UserReactivateView, UserLoginView __author__ = 'misternando' urlpatterns = patterns('', url(r'^$', UserListView.as_view(), name='userprofile-list'), url(r'^login/$', UserLoginView.as_view(), name='user-login'), url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/$', UserDetailView.as_view(), name='userprofile-detail'), url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/reactivate/$', UserReactivateView.as_view(), name='userprofile-reactivate'), url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/orgs/$', OrganizationListView.as_view(), {'related_object_type': UserProfile, 'related_object_kwarg': 'user'}, name='userprofile-orgs'), url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/', include('sources.urls')), url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/collections/', include('collection.urls')), )
from django.urls import include, path from users.views import UserListView urlpatterns = [ path('', UserListView.as_view(), name='allusers'), ]
"""manager URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from users.views import UserListView from home.views import Index urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^users/', UserListView.as_view()), url(r'^$', Index.as_view()), ]
from django.conf.urls import patterns, url, include from orgs.models import Organization from orgs.views import OrganizationDetailView, OrganizationListView, OrganizationMemberView from users.views import UserListView __author__ = 'misternando' urlpatterns = patterns('', url(r'^$', OrganizationListView.as_view(), name='organization-list'), url(r'^(?P<org>[a-zA-Z0-9\-\.]+)/$', OrganizationDetailView.as_view(), name='organization-detail'), url(r'^(?P<org>[a-zA-Z0-9\-\.]+)/members/$', UserListView.as_view(), {'related_object_type': Organization, 'related_object_kwarg': 'org', 'related_object_attribute': 'members'}, name='organization-members'), url(r'^(?P<org>[a-zA-Z0-9\-\.]+)/members/(?P<user>[a-zA-Z0-9\-]+)/$', OrganizationMemberView.as_view(), name='organization-member-detail'), url(r'^(?P<org>[a-zA-Z0-9\-\.]+)/sources/', include('sources.urls')), url(r'^(?P<org>[a-zA-Z0-9\-\.]+)/collections/', include('collection.urls')), )
from se2015.views import IndexView from records.views import ExerciseRecordView, ExamRecordView from records.views import ExamRecordUserView from exercises.views import ExerciseView, SkillView, GradeView, ExamDetailView from exercises.views import ExamListView urlpatterns = [ url(r'^api/v1/avatar/(?P<username>.+)/$', AvatarView.as_view()), url(r'^api/v1/exam_list/(?P<grade_id>.+)/$', ExamListView.as_view()), url(r'^api/v1/exam/(?P<exam_id>.+)/$', ExamDetailView.as_view()), url(r'^api/v1/exam_record_user/(?P<exam_id>.+)/$', ExamRecordUserView.as_view()), url(r'^api/v1/exam_record/(?P<exam_id>.+)/$', ExamRecordView.as_view()), url(r'^api/v1/exercise/(?P<grade_id>.+)/(?P<skill_id>.+)/$', ExerciseView.as_view()), url(r'^api/v1/exercise/(?P<grade_id>.+)/$', SkillView.as_view()), url(r'^api/v1/grades/$', GradeView.as_view()), url(r'^api/v1/accounts/records/(?P<username>.+)/$', ExerciseRecordView.as_view(), name='recordDetail'), url(r'^api/v1/accounts/(?P<username>.+)/$', UserDetailView.as_view(), name='detail'), url(r'^api/v1/accounts/', UserListView.as_view(), name='list'), url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'), url(r'^api/v1/auth/logout/$', LogoutView.as_view(), name='logout'), url(r'^admin/', include(admin.site.urls)), url('^.*$', IndexView.as_view(), name='index'), ]
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 manager.views import ProjectInfoView,AddProjectView,ModifyProjectView,VersionListView,AddVersionView,\ ModifyVersionView,DelProjectView,DelVersionView,ServiceInfoView,AddServiceView,ModifyServiceView,DelServiceView from users.views import UserListView, SearchUserView urlpatterns = [ url(r'plist$', ProjectInfoView.as_view(), name='plist'), url(r'AddProject$', AddProjectView.as_view(), name='AddProject'), url(r'ModifyProject/(?P<project_id>.*)/$', ModifyProjectView.as_view(), name='ModifyProject'), url(r'DelProject$', DelProjectView.as_view(), name='DelProject'), url(r'VersionList$', VersionListView.as_view(), name='VersionList'), url(r'AddVersion$', AddVersionView.as_view(), name='AddVersion'), url(r'ModifyVersion/(?P<version_id>.*)/$', ModifyVersionView.as_view(), name='ModifyVersion'), url(r'DelVersion$', DelVersionView.as_view(), name='DelVersion'), url(r'UserList$', UserListView.as_view(), name='UserList'), url(r'SearchUser$', SearchUserView.as_view(), name='SearchUser'), url(r'ServiceList$', ServiceInfoView.as_view(), name='ServiceList'), url(r'AddService$', AddServiceView.as_view(), name='AddService'), url(r'ModifyService/(?P<service_id>.*)/$', ModifyServiceView.as_view(), name='ModifyService'), url(r'DelService$', DelServiceView.as_view(), name='DelService'), ]
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 django.views.generic import TemplateView from rest_framework import routers from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView, TokenVerifyView) from users.views import (UserCreateView, UserUpdateView, UserAdminCreateView, UserRetrieveView, UserListView, UserDestroyView, UserTokenView) urlpatterns = [ path('api/users/', UserListView.as_view()), path('api/users/new/', UserCreateView.as_view()), path('api/users/edit/<int:pk>/', UserUpdateView.as_view()), path('api/users/<int:pk>/', UserRetrieveView.as_view()), path('api/users/admin-new/', UserAdminCreateView.as_view()), path('api/users/delete/<int:pk>/', UserDestroyView.as_view()), path('api/admin/', admin.site.urls), path('api/auth/', include('rest_framework.urls', namespace='rest_framework')), path('api/token/', UserTokenView.as_view()), path('api/token/refresh', TokenRefreshView.as_view()), path('api/token/verify', TokenVerifyView.as_view()), re_path('.*', TemplateView.as_view(template_name='index.html')), ]
"""django_rest_network 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.urls import path from users.views import UserDetailView, UserListView, LoginView, RegisterUsersView urlpatterns = [ path('auth/login/', LoginView.as_view(), name="auth-login"), path('auth/register/', RegisterUsersView.as_view(), name="auth-register"), path('', UserListView.as_view()), path('<int:pk>/', UserDetailView.as_view()), ]
from DjangoLibre.urls import path from users.views import UserListView, UserLoginView, UserLogoutView, SignupCreateView, UserDetailView app_name = 'users' urlpatterns = [ path('list', UserListView.as_view(), name='list_users'), #pagian inicial, view, name path('login', UserLoginView.as_view(), name='login_users'), path('logout', UserLogoutView.as_view(), name='logout_users'), path('signup', SignupCreateView.as_view(), name='signup_users'), path('users/<int:pk>/detail', UserDetailView.as_view(), name='detail_users'), ]
from django.urls import path from users.views import UserListView, UserDetailView urlpatterns = [ path('', UserListView.as_view(), name="users-list"), path('<int:pk>/', UserDetailView.as_view(), name="user-detail"), ]
from django.urls import path from openweather.views import CreateCityView from users.views import CreateUserView, UserFullListView, UserListView from .views import UserManageView, CityManageView, FavouriteManageView ''' Struktura je posložena tako da okupi managere na istom endpointu, uz managere idu i ostali API koji imaju različite endpointove. Kreiranje gradova prima ime grada (kw='name') i njegov API id (kw='api_id') s OpenWeatherMap API-ja. Kreiranje korisnika prima username, email i password (kw:'username', 'email', 'password'). Lista korisnika daje osnovne, nesenzitivne (relativno) podatke o korisnicima, dostupna svima. Full lista korisnika daje sve podatke o korisnicima, dostupna samo admin/superuser korisnicima. ''' urlpatterns = [ path('users/<int:pk>/', UserManageView.as_view()), path('cities/<int:pk>/', CityManageView.as_view()), path('fav/<int:api_id>/<str:name>/', FavouriteManageView.as_view()), path('cities/create/', CreateCityView.as_view()), path('users/create/', CreateUserView.as_view()), path('users/list/', UserListView.as_view()), path('users/full/', UserFullListView.as_view()), ]
from django.conf.urls import patterns, url, include from orgs.models import Organization from orgs.views import OrganizationDetailView, OrganizationListView, OrganizationMemberView from users.views import UserListView from oclapi.models import NAMESPACE_PATTERN __author__ = 'misternando' urlpatterns = patterns( '', url(r'^$', OrganizationListView.as_view(), name='organization-list'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/$', OrganizationDetailView.as_view(), name='organization-detail'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/members/$', UserListView.as_view(), { 'related_object_type': Organization, 'related_object_kwarg': 'org', 'related_object_attribute': 'members' }, name='organization-members'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/members/(?P<user>' + NAMESPACE_PATTERN + ')/$', OrganizationMemberView.as_view(), name='organization-member-detail'), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/sources/', include('sources.urls')), url(r'^(?P<org>' + NAMESPACE_PATTERN + ')/collections/', include('collection.urls')), )
from rest_framework.authtoken.views import obtain_auth_token from rest_framework_swagger.views import get_swagger_view from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer from rest_framework.schemas import get_schema_view from rest_framework_jwt.views import obtain_jwt_token from rest_framework_jwt.views import refresh_jwt_token from rest_framework_jwt.views import verify_jwt_token from users.views import UserListView, CreateUserView, auth_user schema_view = get_swagger_view(title='Divorces API') urlpatterns = [ path('auth/', auth_user), path('register/', CreateUserView.as_view()), path('users/', UserListView.as_view()), path('users/<int:pk>/', UserListView.as_view()), path('grappelli/', include('grappelli.urls')), # grappelli URLS path('admin/', admin.site.urls), path('openapi', get_schema_view( title="Your Project", description="API for all things …" ), name='openapi-schema'), path('swagger-ui/', TemplateView.as_view( template_name='swagger-ui.html', extra_context={'schema_url':'openapi-schema'} ), name='swagger-ui'), path('redoc/', TemplateView.as_view( template_name='redoc.html', extra_context={'schema_url':'openapi-schema'} ), name='redoc'),
from django.urls import path from users.views import UserListView, UserLoginView, UserLogoutView, UserSignUpView, UserDetailView app_name = 'users' urlpatterns = [ path('list', UserListView.as_view(), name='list_users'), path('login', UserLoginView.as_view(), name='login_users'), path('logout', UserLogoutView.as_view(), name='logout_users'), path('signup', UserSignUpView.as_view(), name='signup_users'), path('users/<int:pk>/detalhes', UserDetailView.as_view(), name='detail_users'), ]
from django.conf.urls import url from permissions.views import AddPermissionView, DeletePermissionView, EditPermissionView from users.views import CreateUserView, UserListView, ManageUserView urlpatterns = [ url(r'new', CreateUserView.as_view(), name='create_user'), url(r'(?P<user_id>[\w\-]+)/manage', ManageUserView.as_view(), name='manage_user'), url(r'(?P<user_id>[\w\-]+)/add_permission', AddPermissionView.as_view(), name='add_permission'), url(r'(?P<user_id>[\w\-]+)/edit_permission/(?P<permission_id>[\w\-]+)', EditPermissionView.as_view(), name="edit_permission"), url(r'(?P<user_id>[\w\-]+)/delete_permission/(?P<permission_id>[\w\-]+)', DeletePermissionView.as_view(), name='delete_permission'), url(r'', UserListView.as_view(), name='user_list') ]
# /users/:user/sources/:source/mappings/:mapping/ - points to "mapping-details" url( r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/(?P<mapping_version>[a-zA-Z0-9\-\.]+)/$', # pylint: disable=C0301 MappingDetailsView.as_view(), name='mapping-version-home'), # /users/:user/sources/:source/mappings/:mapping/ - points to "mapping-details" url( r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/(?P<mapping_version>[a-zA-Z0-9\-\.]+)/history/$', # pylint: disable=C0301 MappingVersionsView.as_view(), name='mapping-versions'), ## CORE USER - are these used at all? # URL pattern for the UserListView url(r'^$', UserListView.as_view(), name='list'), # URL pattern for the UserRedirectView url(r'^~redirect/$', UserRedirectView.as_view(), name='redirect'), # URL pattern for the UserDetailView url(r'^(?P<username>[\w@\.\+\-_]+)/$', UserDetailView.as_view(), name='detail'), # URL pattern for the UserUpdateView url(r'^update/(?P<username>[\w@\.\+\-_]+)/$', UserUpdateView.as_view(), name='update'), ## SELFISH URLs
from django.urls import path, include from rest_framework.routers import DefaultRouter from users.api import UserCreateView, UserDetailView, UserListApiView from users.views import LoginView, UserListView, LogoutView, RegisterView router = DefaultRouter() router.register('users', UserCreateView, basename='users') router.register('users', UserDetailView, basename='users') router.register('blogs', UserListApiView, basename='blogs') urlpatterns = [ path('login', LoginView.as_view(), name='login'), path('logout', LogoutView.as_view(), name='logout'), path('register', RegisterView.as_view(), name='register'), path('login', LoginView.as_view(), name='login'), path('blogs', UserListView.as_view(), name='user_list'), path('api/1.0/', include(router.urls), name='user_api'), ]
from django.conf.urls import patterns, url, include from collection.views import OrganizationCollectionListView from orgs.views import OrganizationListView from sources.views import OrganizationSourceListView from users.models import UserProfile from users.views import UserListView, UserDetailView, UserReactivateView, UserLoginView from oclapi.models import NAMESPACE_PATTERN __author__ = 'misternando' urlpatterns = patterns('', url(r'^$', UserListView.as_view(), name='userprofile-list'), url(r'^login/$', UserLoginView.as_view(), name='user-login'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/$', UserDetailView.as_view(), name='userprofile-detail'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/reactivate/$', UserReactivateView.as_view(), name='userprofile-reactivate'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/orgs/$', OrganizationListView.as_view(), {'related_object_type': UserProfile, 'related_object_kwarg': 'user'}, name='userprofile-orgs'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/orgs/sources/$', OrganizationSourceListView.as_view(), name='userprofile-organization-source-list'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/orgs/collections/$', OrganizationCollectionListView.as_view(), name='userprofile-organization-collection-list'), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/sources/', include('sources.urls')), url(r'^(?P<user>' + NAMESPACE_PATTERN + ')/collections/', include('collection.urls')) )
"""src URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from users.views import UserListView, UserDetailView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^user/login/$', 'users.views.login_view', name='login_view'), url(r'^user/logout/$', 'users.views.logout_view', name='logout_view'), url(r'^user/register/$', 'users.views.register_user', name='register_view'), url(r'^user/list/$', UserListView.as_view(), name='user_list_view'), url(r'^user/(?P<pk>\d+)/$', UserDetailView.as_view(), name='user_detail_view'), url(r'^user/(?P<pk>\d+)/edit$', 'users.views.user_edit_profile', name='user_edit_view'), # url(r'^user/list/$', 'users.views.user_list_view', name='user_list_view'), ]
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from rest_framework import routers from users import views from users.views import UserListView, TaskView, TaskDetailsView router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) router.register(r'groups', views.GroupViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), url(r'^user_list/', UserListView.as_view(), name='example_view'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^tasks/', TaskView.as_view(), name='task_view'), url(r'^task/details/(?P<pk>\d+)/$', TaskDetailsView.as_view(), name='update_task'), ]
MappingRetireView.as_view(), name='mapping-retire'), # /users/:user/sources/:source/mappings/:mapping/ - points to "mapping-details" url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/(?P<mapping_version>[a-zA-Z0-9\-\.]+)/$', # pylint: disable=C0301 MappingDetailsView.as_view(), name='mapping-version-home'), # /users/:user/sources/:source/mappings/:mapping/ - points to "mapping-details" url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/mappings/(?P<mapping>[a-zA-Z0-9\-\.]+)/(?P<mapping_version>[a-zA-Z0-9\-\.]+)/history/$', # pylint: disable=C0301 MappingVersionsView.as_view(), name='mapping-versions'), ## CORE USER - are these used at all? # URL pattern for the UserListView url(r'^$', UserListView.as_view(), name='list'), # URL pattern for the UserRedirectView url(r'^~redirect/$', UserRedirectView.as_view(), name='redirect'), # URL pattern for the UserDetailView url(r'^(?P<username>[\w@\.\+\-_]+)/$', UserDetailView.as_view(), name='detail'), # URL pattern for the UserUpdateView url(r'^update/(?P<username>[\w@\.\+\-_]+)/$', UserUpdateView.as_view(), name='update'),
path('password-reset/', auth_views.PasswordResetView.as_view( template_name='users/password_reset.html'), name='password_reset'), path('password-reset/done/', auth_views.PasswordResetDoneView.as_view( template_name='users/password_reset_done.html'), name='password_reset_done'), path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view( template_name='users/password_reset_confirm.html'), name='password_reset_confirm'), path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view( template_name='users/password_reset_complete.html'), name='password_reset_complete'), path('users/', UserListView.as_view(), name='users'), path('change-password/', user_views.change_password, name='change_password'), path('create-moderator/', user_views.onboard_moderator, name='create-moderator'), re_path(r'^account_activation_sent/$', user_views.account_activation_sent, name='account_activation_sent'), re_path( r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', user_views.activate, name='activate'), ]
#!/usr/bin/python # -*- coding:utf-8 -*- from django.urls import path, include, re_path from users.views import UserListView, UploadImageView, UserUpdateModify, SendEMailView, UpdateEmailView, MyCourseView, \ MyFavOrgView, MyTeacherView, MyFavCourseView, MyMessageView urlpatterns = [ path('info/', UserListView.as_view()), path('image/upload', UploadImageView.as_view(), name='image/upload'), path('upload/pwd/', UserUpdateModify.as_view(), name='upload/pwd'), path('sendemail_code/', SendEMailView.as_view(), name='sendemail_code'), path('UpdateEmailView/', UpdateEmailView.as_view(), name='UpdateEmailView'), path('MyCourseView/', MyCourseView.as_view(), name='MyCourseView'), path('MyFavOrgView/', MyFavOrgView.as_view(), name='MyFavOrgView'), path('MyTeacherView/', MyTeacherView.as_view(), name='MyTeacherView'), path('MyFavCourseView/', MyFavCourseView.as_view(), name='MyFavCourseView'), path('MyMessageView/', MyMessageView.as_view(), name='MyMessageView'), ]