Пример #1
0
from django.urls import path
from django.contrib.auth.views import LogoutView
from accounts.views import LoginView, SignUp, UserDetailView, UserUpdateView, UserDeleteView, UserPasswordChangeView, \
    UserListView, UserSearchView, SearchResultsView, BanChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('create/', SignUp.as_view(), name='create'),
    path('profile/<int:pk>/', UserDetailView.as_view(), name='user_detail'),
    path('profile/<int:pk>/update/', UserUpdateView.as_view(), name='user_update'),
    path('profile/<int:pk>/delete/', UserDeleteView.as_view(), name='user_delete'),
    path('profile/<int:pk>/change_password/', UserPasswordChangeView.as_view(), name='user_change_password'),
    path('profile/list/', UserListView.as_view(), name='user_list'),
    path('user/search/', UserSearchView.as_view(), name='user_search'),
    path('user/search/results/', SearchResultsView.as_view(), name='search_results'),
    path('users/change_ban/<int:pk>/', BanChangeView.as_view(), name="ban_change"),

]
Пример #2
0
    UserUpdateView,
    UserDeleteView,
    CampOwnerFollowToggle,
    AllUsers,
    # Validation URLS
    validate_username,
    validate_email,
    ban_user,
)

app_name = 'users'

user_patterns = [
    path('<username>/', UserDetailView.as_view(), name='user_detail'),
    path('<username>/update/', UserUpdateView.as_view(), name='user_update'),
    path('<username>/delete/', UserDeleteView.as_view(), name='user_delete'),
    path('follow', CampOwnerFollowToggle.as_view(), name='campowner_follow'),
    path('allUsers', AllUsers.as_view(), name='all_users'),
    path('ban_user', ban_user, name='ban_user'),
]

validate_patterns = [
    path('username/', validate_username, name="validate_username"),
    path('email/', validate_email, name="validate_email"),
]

urlpatterns = [
    # Login, Logout, Register
    path('login/',
         LoginView.as_view(template_name='accounts/registration/login.html',
                           redirect_authenticated_user=True),
Пример #3
0
             template_name='registration/password_reset_confirm.html',
             form_class=UserPasswordResetConfirmForm),
         name='password_reset_confirm'),
    path('password_change/',
         PasswordChangeView.as_view(
             template_name="registration/password_change_form.html",
             form_class=UserPasswordChangeForm),
         name='password_change'),
    path('activate/<uidb64>/<token>/', activate, name='activate'),
    path('registration/', UserRegistrationView.as_view(), name='registration'),
    path('profile/', UserProfileView.as_view(), name='profile'),
    path('profile/update/<int:pk>/',
         UserUpdateView.as_view(),
         name='profile-update'),
    path('profile/delete/<int:pk>/',
         UserDeleteView.as_view(),
         name='profile-delete'),
    path('profile/companies/', CompanyListView.as_view(), name='companies'),
    path('profile/managers/',
         ManagerListView.as_view(template_name='managers/manager_list.html'),
         name='managers'),
    path('profile/companies/add/',
         CompanyCreateView.as_view(),
         name='companies-add'),
    path('profile/companies/update/<slug:slug>/',
         CompanyUpdateView.as_view(),
         name='companies-update'),
    path('profile/companies/delete/<slug:slug>/',
         CompanyDeleteView.as_view(),
         name='companies-delete'),
]
Пример #4
0
from django.urls import path
from accounts.views import UserCreateView, UserListView, UserDetailedView, UserUpdateView, UserDeleteView, generate_csv

app_name = 'accounts'

urlpatterns = [
    path('create_user/', UserCreateView.as_view(), name="create_user"),
    path('user_list/', UserListView.as_view(), name="user_list"),
    path('users/<pk>/', UserDetailedView.as_view(), name="user_detail"),
    path('update/<pk>/', UserUpdateView.as_view(), name="user_update"),
    path('delete/<pk>/', UserDeleteView.as_view(), name="user_delete"),
    path('user_list/generate_csv/', generate_csv, name="generate_csv")
]
Пример #5
0
# URLconfs have a hook that lets you pass extra arguments to your view FUNCTIONS (!), as a Python dictionary.
#   url(r'^blog/(?P<year>[0-9]{4})/$', views.year_archive, {'foo': 'bar'}),
#  for a request to /blog/2005/, Django will call views.year_archive(request, year='2005', foo='bar').


urlpatterns = [
    url(r'^register/$', MyRegistrationView.as_view(), name='register'),

    url(r'^register/complete/$', TemplateView.as_view(template_name='accounts/registration_complete.html'),
        name='registration_complete'),

    url(r'^login/$', MyLogin.as_view(), name='login'),
    url(r'^logout/$', login_required(add_lang(auth_views.logout)), {'template_name': 'accounts/logout.html'}, name='logout'),

    url(r'^userlist/$', tableUser, name='userlist'),
    url(r'^userlist/(?P<pk>[0-9]+)/$', UserDeleteView.as_view(), name='user_del'),

    url(r'^password/change/$', login_required(add_lang(auth_views.password_change)),
        {'post_change_redirect': reverse_lazy('auth_password_change_done'),
         'template_name': 'accounts/password_change_form.html'},name='auth_password_change'),

    url(r'^password/change/done/$', login_required(add_lang(auth_views.password_change_done)),
        {'template_name': 'accounts/password_change_done.html'}, name='auth_password_change_done'),

    url(r'^password/reset/$', add_lang(auth_views.password_reset), {'template_name': 'accounts/password_reset_form.html',
        'post_reset_redirect': reverse_lazy('auth_password_reset_done')},name='auth_password_reset'),

    url(r'^password/reset/complete/$', login_required(add_lang(auth_views.password_reset_complete)),
        {'template_name': 'accounts/password_reset_complete.html'}, name='auth_password_reset_complete'),

    url(r'^password/reset/done/$', login_required(add_lang(auth_views.password_reset_done)),
Пример #6
0
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView
from accounts.views import RegisterView, UserDetailView, UsersListView, UserPasswordChangeView, UserChangeView, \
    UserDeleteView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', RegisterView.as_view(), name='create'),
    path('<int:pk>/', UserDetailView.as_view(), name='detail'),
    path('list/', UsersListView.as_view(), name='list'),
    path('<int:pk>/update/', UserChangeView.as_view(), name='change'),
    path('<int:pk>/delete/', UserDeleteView.as_view(), name='delete'),
    path('<int:pk>/password-change/',
         UserPasswordChangeView.as_view(),
         name='password_change'),
]
Пример #7
0
from django.urls import path
from accounts.views import ProfilesListView, ProfileCreateView, ProfileDetailView, ProfileEditView, UserDeleteView

app_name = 'profiles'

urlpatterns = [
    path('', ProfilesListView.as_view(), name='list'),
    path('add/', ProfileCreateView.as_view(), name='add'),
    path('edit/<item_id>', ProfileEditView.as_view(), name='edit'),
    path('show/<item_id>', ProfileDetailView.as_view(), name='show'),
    path('delete/<item_id>', UserDeleteView.as_view(), name='delete'),
    path('publication/<item_id>', UserDeleteView.as_view(), name='publication')
]