Beispiel #1
0
 def test_get_user(self):
     request = self.factory.get("/get-user/")
     force_authenticate(request, self.sample_user)
     response = UserDetailView.as_view()(request)
     assert response.status_code == 200
     assert response.data == {
         "id": 1,
         "username": "******",
         "email": "sample_email",
     }
Beispiel #2
0
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"),
]
Beispiel #3
0
        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
    # NOTE: Placed at the end so that reserved words aren't incorrectly treated like mnemonics

    # /users/:user/sources/:source/:version/ - points to 'source-details'
    url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/(?P<source_version>[a-zA-Z0-9\-\.]+)/$',    # pylint: disable=C0301
        SourceDetailsView.as_view(), name='source-version-home'),

    ## Collection CORE
Beispiel #4
0
"""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'),
]
Beispiel #5
0
from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework.routers import DefaultRouter
from users.views import UsernameCountView,MobileCountView,UserView,SMSCodeToKenView,PasswordTokenView,\
    PasswordView,UserDetailView,EmailView,EmailVerifyView,AddressViewSet,UserBrowsingHistoryView,\
    UserAuthorizationView

urlpatterns = [
    url(r'^usernames/(?P<username>\w{5,20})/count/$', UsernameCountView.as_view()),#注册时判断用户名是否存在
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', MobileCountView.as_view()),#注册时判断手机号码是否存在
    url(r'^users/$', UserView.as_view()),#注册表单提交
    url(r'^authorizations/$', UserAuthorizationView.as_view()),#注册成功后,用jwt的token,直接登陆成功,登陆页面直接请求
    url(r'^accounts/(?P<account>\w{4,20})/sms/token/$',SMSCodeToKenView.as_view()),#忘记密码找回密码需要发送短信
    url(r'^accounts/(?P<account>\w{4,20})/password/token/$',PasswordTokenView.as_view()),#忘记密码找回密码需要修改密码的token
    url(r'^users/(?P<pk>\d+)/password/$', PasswordView.as_view()),#忘记密码找回密码需要修改密码
    url(r'^user/$', UserDetailView.as_view()),#用户个人中心接口
    url(r'^emails/$', EmailView.as_view()),#邮箱验证
    url(r'^emails/verification/$', EmailVerifyView.as_view()),#邮箱激活
    url(r'^browse_histories/$', UserBrowsingHistoryView.as_view()),#历史浏览记录保存


]

router = DefaultRouter()
router.register(r'addresses', AddressViewSet, base_name='addresses')

urlpatterns += router.urls
# POST /addresses/ 新建  -> create
# PUT /addresses/<pk>/ 修改  -> update
# GET /addresses/  查询  -> list
# DELETE /addresses/<pk>/  删除 -> destroy
from django.urls import path
from users.views import UserLoginView, UserLogoutView, UserDetailView, UserSignupView, UserUpdateView, UserFollowView

app_name = 'users'

urlpatterns = [
    path('login/', UserLoginView.as_view(), name='login_user'),
    path('logout/', UserLogoutView.as_view(), name='logout_user'),
    path('perfil/<int:pk>', UserDetailView.as_view(), name='detail_user'),
    path('signup/', UserSignupView.as_view(), name='signup_user'),
    path('editar_perfil/<int:pk>/',
         UserUpdateView.as_view(),
         name='update_user'),
    path('seguir/<int:pk>/', UserFollowView.as_view(), name='follow_user')
]
Beispiel #7
0
from django.contrib import admin

from users.views import (AppointmentRequestView, RequestedPatientList,
                         ApprovelPatientList, ApprovalRequestView,
                         UserDetailView, DoctorListView, MyProfileView,
                         CreateUser, AddPrescriptionView, ListPrescriptionView,
                         DoctorListSpecialityView, PatientAppoinmentListView,
                         RejectRequestView)

urlpatterns = [
    url(r'^user/list-patient-appoinments/$',
        PatientAppoinmentListView.as_view()),
    url(r'^add-prescription/(?P<user_id>[0-9]+)/$',
        AddPrescriptionView.as_view()),
    url(r'^list-prescription/$', ListPrescriptionView.as_view()),
    url(r'^user/(?P<user_id>[0-9]+)/$', UserDetailView.as_view()),
    url(r'^user/$', CreateUser.as_view()),
    url(r'^user/my-profile/$', MyProfileView.as_view()),
    url(r'^user/doctor-list/speciality-wise/$',
        DoctorListSpecialityView.as_view()),
    url(r'^user/doctor-list/$', DoctorListView.as_view()),
    url(r'^appoinment-request/(?P<doctor_id>[0-9]+)/$',
        AppointmentRequestView.as_view()),
    url(r'^approval-request/(?P<patient_id>[0-9]+)/$',
        ApprovalRequestView.as_view()),
    url(r'^requested-patient-list/$', RequestedPatientList.as_view()),
    url(r'^approved-patient-list/$', ApprovelPatientList.as_view()),
    url(r'^approved-patient-list/$', ApprovelPatientList.as_view()),
    url(r'^reject-request/(?P<patient_id>[0-9]+)/$',
        RejectRequestView.as_view()),
]
Beispiel #8
0


    ## 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
    # NOTE: Placed at the end so that reserved words aren't incorrectly treated like mnemonics

    # /users/:user/sources/:source/:version/ - points to 'source-details'
    url(r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/(?P<source_version>[a-zA-Z0-9\-\.]+)/$',    # pylint: disable=C0301
        SourceDetailsView.as_view(), name='source-version-home'),

)
Beispiel #9
0
from django.urls import path
from users.views import UserLoginView, UserDetailView, UserListView, UserSignupView, UserLogoutView

app_name = 'users'

urlpatterns = [
    path('login', UserLoginView.as_view(), name='login'),
    path('signup', UserSignupView.as_view(), name='signup'),
    path('logout', UserLogoutView.as_view(), name="logout"),
    path('details/<int:pk>/', UserDetailView.as_view(), name="details"),
]
Beispiel #10
0
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 CustomPasswordChangeView, CustomPasswordResetView, UsersCreateView, UserUpdateView, \
    UserDetailView, UserDeleteView, UsersListView, UsersCreateNewView, UserUpdateClientView

app_name = 'users'
urlpatterns = [
    path('change-password/',
         CustomPasswordChangeView.as_view(),
         name='change_password'),
    path('password-reset/',
         CustomPasswordResetView.as_view(),
         name='reset_password'),
    path('', UsersListView.as_view(), name='index'),
    path('create', UsersCreateView.as_view(), name='create'),
    path('createuser', UsersCreateNewView.as_view(), name='createuser'),
    path('edit', UserUpdateClientView.as_view(), name='edit'),
    path('update/<int:pk>/', UserUpdateView.as_view(), name='update'),
    path('detail/<int:pk>/', UserDetailView.as_view(), name='detail'),
    path('delete/<int:pk>/', UserDeleteView.as_view(), name='delete'),
]
Beispiel #11
0
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from users.views import UserUpdateView,UserDetailView,UserCreateView,ActivationView
from users import views
urlpatterns = patterns('',
    url(r'^update-profile/(?P<pk>\d+)/$',UserUpdateView.as_view(), name='update-profile'),
    url(r'^ajax_check_auth/', views.ajax_check_auth, name='ajax'),
    url(r'^profile/$', 'users.views.userprofile', name='profile'),
    url(r"^my-profile/(?P<pk>\d+)/$", UserDetailView.as_view(), name="user_detail"),
    url(r"^create-account/$", UserCreateView.as_view(), name="register"),
    url(r'^activate/(?P<activation_key>\w+)/$',ActivationView.as_view(),name='registration_activate'),
    url(r'^logout/(?P<next_page>.*)/$', 'django.contrib.auth.views.logout', name='logout'),
    url(r"^accounts/login/$", views.login_user, name = "login"),
)

        
Beispiel #12
0
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'),
]
Beispiel #13
0
from projects.views import ProjectViewSet
from deploy.views import TaskViewSet
from inventory.views import InventoryViewSet
from pillars.views import VarsViewSet, ConfigurationViewSet
from manager.utils import TemplateViewWithCsrf
from manager.views import debug, test
from deploy.views import do_deploy

router = routers.DefaultRouter()
router.register(r'users', UserViewSet)
router.register(r'hosts', HostViewSet)
router.register(r'host_groups', HostGroupViewSet)
router.register(r'user_groups', UserGroupViewSet)
router.register(r'projects', ProjectViewSet)
router.register(r'configurations', ConfigurationViewSet)
router.register(r'vars', VarsViewSet)
router.register(r'tasks', TaskViewSet)
router.register(r'inventories', InventoryViewSet)

urlpatterns = [
    url(r'^api/', include(router.urls)),
    path('user', UserDetailView.as_view()),
    path('login', FLoginView.as_view()),
    path('logout', FLogoutView.as_view()),
    path('host_group/content', HostGroupContentView.as_view()),
    path('deploy', do_deploy),
    path('debug', debug),
    path('test', test),
    url(r'', TemplateViewWithCsrf.as_view(template_name="index.html")),
]
Beispiel #14
0
"""todochat 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.urls import path
from users.views import profile, profile_edit, UserDetailView, UserChatView
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('', profile, name="profile"),
    path('edit/', profile_edit, name="profile_edit"),
    path('<str:username>/', UserDetailView.as_view(), name='user_detail'),
    path('<str:username>/chat/', UserChatView.as_view(), name='user_chat')
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Beispiel #15
0
from django.urls import path

from users.views import CreateUserView, UserDetailView, AuthenticateView, index

urlpatterns = [
    path('users', CreateUserView.as_view()),
    path('users/<int:pk>', UserDetailView.as_view()),
    path('login', AuthenticateView.as_view()),
    path('', index),
]
Beispiel #16
0
from django.conf.urls import patterns, url
from collection.views import CollectionListView, CollectionRetrieveUpdateDestroyView, CollectionVersionRetrieveUpdateDestroyView, CollectionVersionChildListView, CollectionVersionListView
from concepts.views import ConceptCreateView, ConceptRetrieveUpdateDestroyView, ConceptVersionRetrieveView, ConceptVersionsView, ConceptReferenceListCreateView, ConceptReferenceRetrieveUpdateDestroyView, ConceptNameRetrieveUpdateDestroyView, ConceptNameListCreateView, ConceptDescriptionRetrieveUpdateDestroyView, ConceptDescriptionListCreateView, ConceptExtrasView, ConceptExtraRetrieveUpdateDestroyView, ConceptMappingsView
from mappings.views import MappingListView, MappingDetailView
from orgs.views import OrganizationListView
from sources.views import SourceListView, SourceRetrieveUpdateDestroyView, SourceVersionRetrieveUpdateView, SourceVersionChildListView, SourceVersionListView, SourceVersionRetrieveUpdateDestroyView
from users.views import UserDetailView

__author__ = 'misternando'

extra_kwargs = {'user_is_self': True}

urlpatterns = patterns('',
    # shortcuts for the currently logged-in user
    url(r'^$', UserDetailView.as_view(), extra_kwargs, name='user-self-detail'),
    url(r'^orgs/$', OrganizationListView.as_view(), extra_kwargs, name='user-organization-list'),
    url(r'^sources/$', SourceListView.as_view(), extra_kwargs, name='user-source-list'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/$', SourceRetrieveUpdateDestroyView.as_view(), extra_kwargs, name='user-source-detail'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/$', ConceptCreateView.as_view(), name='concept-list'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/$', ConceptRetrieveUpdateDestroyView.as_view(), name='concept-detail'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/descriptions/$', ConceptDescriptionListCreateView.as_view(), name='concept-descriptions'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/descriptions/(?P<uuid>[a-zA-Z0-9\-\.]+)/$', ConceptDescriptionRetrieveUpdateDestroyView.as_view(), name='concept-description'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/extras/$', ConceptExtrasView.as_view(), name='concept-extras'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/extras/(?P<extra>[_a-zA-Z0-9\-\.]+)/$', ConceptExtraRetrieveUpdateDestroyView.as_view(), name='concept-extra'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/names/$', ConceptNameListCreateView.as_view(), name='concept-names'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/names/(?P<uuid>[a-zA-Z0-9\-\.]+)/$', ConceptNameRetrieveUpdateDestroyView.as_view(), name='concept-name'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/versions/$', ConceptVersionsView.as_view(), name='concept-version-list'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/mappings/$', ConceptMappingsView.as_view(), name='concept-mapping-list'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/(?P<concept_version>[a-zA-Z0-9\-\.]+)/$', ConceptVersionRetrieveView.as_view(), name='conceptversion-detail'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/(?P<concept_version>[a-zA-Z0-9\-\.]+)/descriptions/$', ConceptDescriptionListCreateView.as_view(), name='concept-descriptions'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/(?P<concept>[a-zA-Z0-9\-\.]+)/(?P<concept_version>[a-zA-Z0-9\-\.]+)/descriptions/(?P<uuid>[a-zA-Z0-9\-\.]+)/$', ConceptDescriptionRetrieveUpdateDestroyView.as_view(), name='concept-name'),
from django.conf.urls import include, url
from django.contrib import admin

from users.views import HomeView, LogoutSessionView, UserDetailView

urlpatterns = [
    url(r'^$', HomeView.as_view(), name='home'),

    url(r'^api/login/', include('rest_social_auth.urls_session')),
    url(r'^api/login/', include('rest_social_auth.urls_token')),

    url(r'^api/logout/session/$', LogoutSessionView.as_view(), name='logout_session'),
    url(r'^api/user/', UserDetailView.as_view(), name="current_user"),
    url(r'^admin/', include(admin.site.urls)),
]
Beispiel #18
0
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_user'),
    path('logout', UserLogoutView.as_view(), name='logout_user'),
    path('signup', UserSignupView.as_view(), name='signup_user'),
    path('about/<int:pk>/user', UserDetailView.as_view(), name='about_user'),
]
Beispiel #19
0
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'),
]
Beispiel #20
0
from django.contrib import admin
from django.conf.urls import include, url
from django.urls import path
from users.views import GoogleLogin, UserDetailView


urlpatterns = [
    url(r'^api-auth/', include('rest_framework.urls')),
#    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
#    url(r'^rest-auth/google/$', GoogleLogin.as_view(), name='google_login'),
	path('user/<slug:slug>/', UserDetailView.as_view())
]
Beispiel #21
0
from django.conf.urls import patterns, url, include
from concepts.views import ConceptCreateView, ConceptRetrieveUpdateDestroyView, ConceptVersionRetrieveView, ConceptVersionsView, ConceptNameRetrieveUpdateDestroyView, ConceptNameListCreateView, ConceptDescriptionRetrieveUpdateDestroyView, ConceptDescriptionListCreateView, ConceptExtrasView, ConceptExtraRetrieveUpdateDestroyView, ConceptMappingsView
from mappings.views import MappingListView, MappingDetailView, MappingVersionDetailView, MappingVersionsListView
from orgs.views import OrganizationListView
from sources.views import SourceListView, SourceRetrieveUpdateDestroyView, SourceVersionRetrieveUpdateView, SourceVersionChildListView, SourceVersionListView, SourceVersionRetrieveUpdateDestroyView
from users.views import UserDetailView

from oclapi.models import NAMESPACE_PATTERN, CONCEPT_ID_PATTERN

__author__ = 'misternando'

extra_kwargs = {'user_is_self': True}

urlpatterns = patterns('',
    # shortcuts for the currently logged-in user
    url(r'^$', UserDetailView.as_view(), extra_kwargs, name='user-self-detail'),
    url(r'^orgs/$', OrganizationListView.as_view(), extra_kwargs, name='user-organization-list'),
    url(r'^sources/$', SourceListView.as_view(), extra_kwargs, name='user-source-list'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/$', SourceRetrieveUpdateDestroyView.as_view(), extra_kwargs, name='user-source-detail'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/$', ConceptCreateView.as_view(), name='concept-list'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/$', ConceptRetrieveUpdateDestroyView.as_view(), name='concept-detail'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/descriptions/$', ConceptDescriptionListCreateView.as_view(), name='concept-descriptions'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/descriptions/(?P<uuid>' + NAMESPACE_PATTERN + ')/$', ConceptDescriptionRetrieveUpdateDestroyView.as_view(), name='concept-description'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/extras/$', ConceptExtrasView.as_view(), name='concept-extras'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/extras/(?P<extra>' + CONCEPT_ID_PATTERN + ')/$', ConceptExtraRetrieveUpdateDestroyView.as_view(), name='concept-extra'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/names/$', ConceptNameListCreateView.as_view(), name='concept-names'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/names/(?P<uuid>' + NAMESPACE_PATTERN + ')/$', ConceptNameRetrieveUpdateDestroyView.as_view(), name='concept-name'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/versions/$', ConceptVersionsView.as_view(), name='concept-version-list'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/mappings/$', ConceptMappingsView.as_view(), name='concept-mapping-list'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/(?P<concept_version>' + NAMESPACE_PATTERN + ')/$', ConceptVersionRetrieveView.as_view(), name='conceptversion-detail'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/(?P<concept>' + CONCEPT_ID_PATTERN + ')/(?P<concept_version>' + NAMESPACE_PATTERN + ')/descriptions/$', ConceptDescriptionListCreateView.as_view(), name='concept-descriptions'),
Beispiel #22
0
urlpatterns = [
    path("", HomeView.as_view(), name="home-page"),
    path("search", SearchView.as_view(), name="search-page"),
    path("login/", UserLoginView.as_view(), name="login-page"),
    path("register/", UserRegisterView.as_view(), name="register-page"),
    re_path(
        r"^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
        UserActivationEmailView.as_view(),
        name="activate-email-link",
    ),
    path(
        "re-send-activation-link/<str:username>",
        UserReSendActivationEmailView.as_view(),
        name="re-send-activate-email-link",
    ),
    path("profile/", UserDetailView.as_view(), name="profile-page"),
    path("update/", UserUpdateView.as_view(), name="update-page"),
    path("logout/", UserLogoutView.as_view(), name="logout-page"),
    path("changepassword/",
         UserChangePasswordView.as_view(),
         name="changepassword-page"),
    path(
        "reset_password/",
        UserForgotPasswordView.as_view(),
        name="send-reset-password-page",
    ),
    re_path(
        r"^reset_password/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
        UserResetForgotPasswordView.as_view(),
        name="reset-password-page",
    ),
Beispiel #23
0
from django.urls import path

from users import views
from users.views import UserDetailView

urlpatterns = [
    path(route='login/', view=views.LoginView.as_view(), name='login'),

    path(route='logout/', view=views.LogoutView.as_view(), name='logout'),

    path(route='signup/', view=views.SignUpView.as_view(), name='signup'),

    path(route='me/profile/', view=views.UpdateProfileView.as_view(), name='update'),

    path(route='<str:username>/', view=UserDetailView.as_view(), name='detail')
]
Beispiel #24
0
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')),
)

Beispiel #25
0
from users.views import UserListView, UserDetailView, NewUserView, LoginView, LogoutView

router = DefaultRouter()
router.register('users', UserViewSet)
router.register('blogs', BlogViewSet)
router.register('categories', CategoryViewSet)
router.register('posts', PostViewSet)
router.register('files', FileViewSet)

urlpatterns = [
    # Admin
    path('admin/', admin.site.urls),

    # Users
    path('users/', UserListView.as_view(), name='user_list'),
    path('users/<int:pk>/', UserDetailView.as_view(), name='user_detail'),
    path('signup/', NewUserView.as_view(), name='signup'),
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),

    # Blogs
    path('blogs/', BlogListView.as_view(), name='blog_list'),
    path('blogs/<int:pk>/', BlogDetailView.as_view(), name='blog_detail'),
    path('new-blog/', NewBlogView.as_view(), name='new_blog'),

    # Categories
    path('categories/', CategoryListView.as_view(), name='category_list'),
    path('categories/<int:pk>/',
         CategoryDetailView.as_view(),
         name='category_detail'),
    path('new-category/', NewCategoryView.as_view(), name='new_category'),
Beispiel #26
0
from django.conf.urls.static import static
from ems_manage.views import ManageView
from users.views import UserDetailView

urlpatterns = [
    path('admin/', admin.site.urls),
    #path('register/', user_views.register, name='register'),
    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('profile/', user_views.profile, name='profile'),
    path('profile/<str:slug>/', UserDetailView.as_view(), name='profile'),
    path('settings/', user_views.settings, name='user_settings'),
    path('manage/', include('ems_manage.urls')),
    # path('manage/', ManageView.as_view(), name='manage-home'),
    path('password-reset/',
         auth_views.PasswordResetView.as_view(
             template_name='users/password_reset.html',
             email_template_name='users/password_reset_email.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'),
Beispiel #27
0
from django.conf.urls import patterns, url, include
from concepts.views import ConceptCreateView, ConceptRetrieveUpdateDestroyView, ConceptVersionRetrieveView, ConceptVersionsView, ConceptNameRetrieveUpdateDestroyView, ConceptNameListCreateView, ConceptDescriptionRetrieveUpdateDestroyView, ConceptDescriptionListCreateView, ConceptExtrasView, ConceptExtraRetrieveUpdateDestroyView, ConceptMappingsView
from mappings.views import MappingListView, MappingDetailView, MappingVersionDetailView, MappingVersionsListView
from orgs.views import OrganizationListView
from sources.views import SourceListView, SourceRetrieveUpdateDestroyView, SourceVersionRetrieveUpdateView, SourceVersionChildListView, SourceVersionListView, SourceVersionRetrieveUpdateDestroyView
from users.views import UserDetailView

__author__ = 'misternando'

extra_kwargs = {'user_is_self': True}

urlpatterns = patterns(
    '',
    # shortcuts for the currently logged-in user
    url(r'^$', UserDetailView.as_view(), extra_kwargs,
        name='user-self-detail'),
    url(r'^orgs/$',
        OrganizationListView.as_view(),
        extra_kwargs,
        name='user-organization-list'),
    url(r'^sources/$',
        SourceListView.as_view(),
        extra_kwargs,
        name='user-source-list'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/$',
        SourceRetrieveUpdateDestroyView.as_view(),
        extra_kwargs,
        name='user-source-detail'),
    url(r'^sources/(?P<source>[a-zA-Z0-9\-\.]+)/concepts/$',
        ConceptCreateView.as_view(),
        name='concept-list'),
Beispiel #28
0
        name='password_change'),
    url(r'^password/change/done/$',
        auth_views.password_change_done,
        kwargs={'template_name': 'users/password_change_done.html'},
        name='password_change_done'),
    url(r'^password/reset/$',
        auth_views.password_reset,
        kwargs={
            'template_name': 'users/password_reset_form.html',
            'email_template_name': 'users/_email_reset_pass.html',
            'subject_template_name': 'users/_email_reset_pass_subj.txt'
        },
        name='password_reset_request'),
    url(r'^password/reset/sent/$',
        auth_views.password_reset_done,
        kwargs={'template_name': 'users/password_reset_sent.html'},
        name='password_reset_done'),
    url(
        r'^password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        auth_views.password_reset_confirm,
        name='password_reset_confirm',
        kwargs={'template_name': 'users/password_reset_confirm.html'},
    ),
    url(r'^password/reset/done/$',
        auth_views.password_reset_complete,
        kwargs={'template_name': 'users/password_reset_done.html'},
        name='password_reset_complete'),
    url(r'^private/$', UserDetailView.as_view(), name='user_detail'),
    url(r'^edit/$', UserUpdateView.as_view(), name='user_edit'),
]
"""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()),

    ]
Beispiel #30
0
from django.conf.urls import patterns, url

from users.views import UserDetailView, UserUpdateView

urlpatterns = patterns(
    '',
    url(r'^(?P<pk>\d+)/$', UserDetailView.as_view(), name='detail'),
    url(r'^(?P<pk>\d+)/register$',
        UserUpdateView.as_view(success_url='/'),
        name='register'),
)
Beispiel #31
0
from django.conf.urls import include, url
from django.contrib import admin

from users.views import HomeView, LogoutSessionView, UserDetailView

urlpatterns = [
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^api/login/', include('rest_social_auth.urls_session')),
    url(r'^api/login/', include('rest_social_auth.urls_token')),
    url(r'^api/logout/session/$',
        LogoutSessionView.as_view(),
        name='logout_session'),
    url(r'^api/user/', UserDetailView.as_view(), name="current_user"),
    url(r'^admin/', include(admin.site.urls)),
]
Beispiel #32
0
from django.conf.urls.defaults import *
from users.forms import UserProfileForm
from users.views import UserDetailView, UserProfileListView, UserProfileDetailView
from django.contrib.auth.models import User

urlpatterns = patterns('',
    url(r'^register/$',
        'users.views.registration',
        name='OA_registration'),
    url(r'^(?P<username>\w+)/$',
        UserDetailView.as_view(
         model=User,
         context_object_name='registered_user',
         template_name='users/user_detail.html',
    ), name='users_user_detail'),
    url(r'^profile/(?P<username>\w+)/$',
        UserProfileDetailView.as_view(),
       name='profiles_profile_detail'),
    url(r'^$',
        UserProfileListView.as_view(),
       name='profiles_profile_list'),
    #url(r'^profile/(?P<username>\w+)/details/$',
    #    UserProfileDetailView.as_view(),
    #   name='user-profile-details'),
)

#urlpatterns += patterns('profiles.views',
#    url(r'^profile/edit/$',
#       'edit_profile',
#       { 'form_class': UserProfileForm },
#       name='profiles_edit_profile'),
Beispiel #33
0
    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
    # NOTE: Placed at the end so that reserved words aren't incorrectly treated like mnemonics

    # /users/:user/sources/:source/:version/ - points to 'source-details'
    url(
        r'^(?P<user>[a-zA-Z0-9\-\.]+)/sources/(?P<source>[a-zA-Z0-9\-\.]+)/(?P<source_version>[a-zA-Z0-9\-\.]+)/$',  # pylint: disable=C0301
        SourceDetailsView.as_view(),
        name='source-version-home'),
Beispiel #34
0
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.conf.urls import url
from django.urls import path
from rest_framework_jwt.views import ObtainJSONWebToken
from users.views import RegisterUserView, UsersListView, UserDetailView
from users.serializers import CustomJWTSerializer

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^login/$',
        ObtainJSONWebToken.as_view(serializer_class=CustomJWTSerializer),
        name='login'),
    url(r'^register/$', RegisterUserView.as_view(), name='register'),
    url(r'^users/$', UsersListView.as_view(), name='list-view'),
    url(r'^users/me/$', UserDetailView.as_view(), name='detail-view')
]
Beispiel #35
0
from concepts.views import ConceptCreateView, ConceptRetrieveUpdateDestroyView, ConceptVersionRetrieveView, ConceptVersionsView, ConceptNameRetrieveUpdateDestroyView, ConceptNameListCreateView, ConceptDescriptionRetrieveUpdateDestroyView, ConceptDescriptionListCreateView, ConceptExtrasView, ConceptExtraRetrieveUpdateDestroyView, ConceptMappingsView
from mappings.views import MappingListView, MappingDetailView, MappingVersionDetailView, MappingVersionsListView
from orgs.views import OrganizationListView
from sources.views import SourceListView, SourceRetrieveUpdateDestroyView, SourceVersionRetrieveUpdateView, SourceVersionChildListView, SourceVersionListView, SourceVersionRetrieveUpdateDestroyView
from users.views import UserDetailView

from oclapi.models import NAMESPACE_PATTERN, CONCEPT_ID_PATTERN

__author__ = 'misternando'

extra_kwargs = {'user_is_self': True}

urlpatterns = patterns(
    '',
    # shortcuts for the currently logged-in user
    url(r'^$', UserDetailView.as_view(), extra_kwargs,
        name='user-self-detail'),
    url(r'^orgs/$',
        OrganizationListView.as_view(),
        extra_kwargs,
        name='user-organization-list'),
    url(r'^sources/$',
        SourceListView.as_view(),
        extra_kwargs,
        name='user-source-list'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/$',
        SourceRetrieveUpdateDestroyView.as_view(),
        extra_kwargs,
        name='user-source-detail'),
    url(r'^sources/(?P<source>' + NAMESPACE_PATTERN + ')/concepts/$',
        ConceptCreateView.as_view(),
Beispiel #36
0
from django.urls import path
from users.views import UserDetailView, UserAuthenticationView

urlpatterns = [
    path('detail/', UserDetailView.as_view(), name = 'User Creation/Deletion'),
    path('auth/', UserAuthenticationView.as_view(), name = 'User Authentication'),
]
Beispiel #37
0
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'))
)

Beispiel #38
0
from django.conf.urls import include, url
from django.views.generic.detail import DetailView
from django.views.generic import ListView
from django.contrib.auth.models import User
from django.views.generic import CreateView
from django.contrib.auth.forms import UserCreationForm
from django.core.urlresolvers import reverse
from django.contrib.auth import views as auth_views
# import django.contrib.auth.views as auth_views
from users.views import UserDetailView
from .views import edit_user, UserListView

urlpatterns = [
    url(r'^u/(?P<pk>\d+)', UserDetailView.as_view(), name='view_user'),

    url(r'^users/$', UserListView.as_view(), name='view_users'),
    url(r'^edit/', edit_user, name="edit_user"),
]
Beispiel #39
0
from django.conf.urls import patterns, url
from users.views import EditProfileView, UsersListView, UserDetailView

urlpatterns = patterns('',
                       url(r'^profile/edit$', EditProfileView.as_view(),
                           name='users.views.profile-edit'),
                       url(r'^users$', UsersListView.as_view(),
                           name='users.views.list-users'),
                       url(r'^users/(?P<pk>\d+)', UserDetailView.as_view(),
                           name='users.views.user-detail'),
                       )
Beispiel #40
0
# __author__ = "MaRuiMin"
from django.urls import path

from users.views import UserDetailView, UserUpdateView

app_name = 'users'

urlpatterns = [
    path(r'update/', UserUpdateView.as_view(), name="update"),
    path('<str:username>/', UserDetailView.as_view(), name="detail")
]