jumpserver/apps/users/urls.py

62 lines
2.7 KiB
Python
Raw Normal View History

from django.conf.urls import url
2016-08-31 12:39:25 +00:00
from django.contrib.auth import views as auth_views
from django.utils.translation import ugettext as _
2016-08-14 09:21:04 +00:00
2016-08-31 12:39:25 +00:00
import views
2016-08-25 05:28:02 +00:00
import api
from users.forms import UserLoginForm
app_name = 'users'
urlpatterns = [
url(r'^login$',
auth_views.login,
{'template_name': "users/login.html",
'authentication_form': UserLoginForm,
'redirect_authenticated_user': True},
name='login'),
url(r'^logout$',
auth_views.logout,
{
"template_name": "common/flash_message_standalone.html",
"extra_context": {
'title': _('Logout success'),
'messages': _('Logout success, return login page'),
'redirect_url': '/users/login',
'auto_redirect': True,
}
},
name='logout'),
2016-08-31 17:12:02 +00:00
url(r'^password/forget$', views.UserForgetPasswordView.as_view(), name='forget-password'),
2016-09-01 15:09:58 +00:00
url(r'^password/forget/sendmail-success$',
views.UserForgetPasswordSendmailSuccessView.as_view(), name='forget-password-sendmail-success'),
url(r'^password/reset$', views.UserResetPasswordView.as_view(), name='reset-password'),
url(r'^password/reset/success$', views.UserResetPasswordSuccessView.as_view(),
name='reset-password-success'),
2016-09-04 08:05:58 +00:00
url(r'^user$', views.UserListView.as_view(), name='user-list'),
url(r'^user/(?P<pk>[0-9]+)$', views.UserDetailView.as_view(), name='user-detail'),
url(r'^user/add$', views.UserAddView.as_view(), name='user-add'),
url(r'^user/(?P<pk>[0-9]+)/edit$', views.UserUpdateView.as_view(), name='user-edit'),
url(r'^user/(?P<pk>[0-9]+)/delete$', views.UserDeleteView.as_view(), name='user-delete'),
url(r'^usergroup$', views.UserGroupListView.as_view(), name='usergroup-list'),
url(r'^usergroup/(?P<pk>[0-9]+)$',
views.UserGroupDetailView.as_view(), name='usergroup-detail'),
2016-09-04 08:05:58 +00:00
url(r'^usergroup/add/$', views.UserGroupAddView.as_view(), name='usergroup-add'),
url(r'^usergroup/(?P<pk>[0-9]+)/edit$',
views.UserGroupUpdateView.as_view(), name='usergroup-edit'),
url(r'^usergroup/(?P<pk>[0-9]+)/delete$',
views.UserGroupDeleteView.as_view(), name='usergroup-delete'),
]
2016-08-25 05:28:02 +00:00
urlpatterns += [
url(r'^v1/users$', api.UserListAddApi.as_view(), name='user-list-api'),
url(r'^v1/users/(?P<pk>[0-9]+)$',
api.UserDetailDeleteUpdateApi.as_view(), name='user-detail-api'),
url(r'^v1/users/(?P<pk>[0-9]+)/active$', api.UserActiveApi.as_view(), name='user-active-api'),
url(r'^v1/usergroups$', api.UserGroupListAddApi.as_view(), name='usergroup-list-api'),
url(r'^v1/usergroups/(?P<pk>[0-9]+)$',
api.UserGroupDetailDeleteUpdateApi.as_view(), name='usergroup-detail-api'),
2016-08-25 05:28:02 +00:00
]