예제 #1
0
def test_get_userprofileview(user):
    factory = RequestFactory()
    path = user.get_absolute_url()
    request = factory.get(path)
    request.user = user
    response = UserProfileView.as_view()(request=request,
                                         unique_id=request.user.unique_id)
    assert response.template_name == ['registration/profile.html']
예제 #2
0
def test_redirect_anonymous_to_login_from_profile():
    path = reverse(
        'accounts:profile',
        kwargs={'unique_id': '8db49825-244b-4ee9-a857-4da3cf40f380'})
    user = AnonymousUser()
    factory = RequestFactory()
    request = factory.get(path)
    request.user = user
    response = UserProfileView.as_view()(
        request, unique_id='8db49825-244b-4ee9-a857-4da3cf40f380')
    assert response.url == '/accounts/login?next=/accounts/profile/8db49825-244b-4ee9-a857-4da3cf40f380/'
예제 #3
0
     auth_views.password_change_done,
     name='auth_password_change_done'),
 url(r'^accounts/password/reset/$',
     auth_views.password_reset,
     name='auth_password_reset'),
 url(r'^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
     auth_views.password_reset_confirm,
     name='auth_password_reset_confirm'),
 url(r'^accounts/password/reset/complete/$',
     auth_views.password_reset_complete,
     name='password_reset_complete'),
 url(r'^accounts/password/reset/done/$',
     auth_views.password_reset_done,
     name='password_reset_done'),
 url(r'^accounts/profile/(?P<pk>\d+)/$',
     UserProfileView.as_view(),
     name='view_profile'),
 url(r'^accounts/profile/(?P<pk>\d+)/items$',
     accounts.views.UserEditorItemSearchView.as_view(),
     name='profile_editoritem_search'),
 url(r'^accounts/profile/(?P<pk>\d+)/projects$',
     accounts.views.UserProjectsView.as_view(),
     name='profile_projects'),
 url(r'^accounts/profile/(?P<pk>\d+)/themes$',
     accounts.views.UserThemesView.as_view(),
     name='profile_themes'),
 url(r'^accounts/profile/(?P<pk>\d+)/extensions$',
     accounts.views.UserExtensionsView.as_view(),
     name='profile_extensions'),
 url(r'^accounts/profile/edit$',
     login_required(UserUpdateView.as_view()),
예제 #4
0
from django.urls import path, include
from accounts.views import SignOutView, SignInView, UserProfileView, SignUpView

urlpatterns = (
    path('accounts/profile/',
         UserProfileView.as_view(),
         name='current user profile'),
    path('accounts/signin/', SignInView.as_view(), name='signin user'),
    path('accounts/profile/<int:pk>/',
         UserProfileView.as_view(),
         name='user profile'),
    path('accounts/signup/', SignUpView.as_view(), name='signup user'),
    path('accounts/signout/', SignOutView.as_view(), name='signout user'),
    path('accounts/', include('django.contrib.auth.urls')),
)

from .receivers import *
예제 #5
0
from django.conf.urls import patterns, url
from accounts.views import UserProfileView

from django.contrib.auth.views import password_change

urlpatterns = patterns(
    '',
    url(r'^profile/', UserProfileView.as_view(), name="account_profile"),
    url(r'^change_pw/', password_change, {
        'template_name': 'registration/password_change.html',
        'post_change_redirect': '/account/profile/', },
        name="password_change"), )
예제 #6
0
 re_path(r'^register/complete/$',
         TemplateView.as_view(
             template_name='registration/registration_done.html'),
         name='register_complete'),
 re_path(r'^business-account-request/$',
         login_required(BusinessRequestView.as_view()),
         name='business_request'),
 re_path(
     r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
     Activate.as_view(),
     name='activate'),
 re_path(r'^my-jobs/$',
         login_required(MyJobsView.as_view()),
         name='my_jobs'),
 re_path(r'^profile/$',
         login_required(UserProfileView.as_view()),
         name='profile'),
 re_path(r'^profile/(?P<slug>[-\w]+)/$',
         login_required(UserDetailView.as_view()),
         name='profile_detail'),
 re_path(r'^profile/(?P<slug>[-\w]+)/update/$',
         login_required(UserUpdateView.as_view()),
         name='profile_update'),
 re_path(r'^user/list/$',
         login_required(UserListView.as_view()),
         name='user_list'),
 re_path(r'^skill/(?P<pk>\d+)/$',
         login_required(SkillDetailView.as_view()),
         name="skill_detail"),
 re_path(r'^skill/(?P<pk>\d+)/update/$',
         login_required(SkillUpdateView.as_view()),
예제 #7
0
from django.conf.urls import patterns, url
from accounts.views import UserProfileView, DeleteAccountView

from django.contrib.auth.views import password_change

urlpatterns = patterns(
    '',
    url(r'^profile/', UserProfileView.as_view(), name="account_profile"),
    url(r'^delete/', DeleteAccountView.as_view(), name="account_delete"),
    url(r'^change_pw/',
        password_change, {
            'template_name': 'registration/password_change.html',
            'post_change_redirect': '/account/profile/',
        },
        name="password_change"),
)
예제 #8
0
"""BookShop 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 import path, include

from accounts.views import UpdateUserView, CreateUserView, UserProfileView, ChangePasswordView

urlpatterns = [
    path("", include("django.contrib.auth.urls")),
    path("user/<int:pk>", UpdateUserView.as_view(), name='userchange'),
    path("userprofile/<int:pk>", UserProfileView.as_view(), name="userprofile"),
    path("changepassword/", ChangePasswordView.as_view(), name="changepassword"),
    path("registration/", CreateUserView.as_view(), name="registration"),

]
예제 #9
0
from django.urls import path
from accounts.views import (
    UserListView,
    UserProfileView,
    UserSubmissionListView,
    UserBlogListView,
    UserContestListView,
    profile_update_view,
)

app_name = 'accounts'

urlpatterns = [
    path('', UserListView.as_view(), name='user-list'),
    path('<str:username>/user-submission-list/',
         UserSubmissionListView.as_view(),
         name='user-submission-list'),
    path('<str:username>/user-blog-list/',
         UserBlogListView.as_view(),
         name='user-blog-list'),
    path('<str:username>/user-contest-list/',
         UserContestListView.as_view(),
         name='user-contest-list'),
    path('<str:username>/update-profile/',
         profile_update_view,
         name='update-profile'),
    path('<str:username>/', UserProfileView.as_view(), name='user-profile'),
]
예제 #10
0
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import path, reverse_lazy

from accounts.views import (logout, login, registration, UserProfileView,
                            UserUpdate)

urlpatterns = [
    path('login/', login, name='login'),
    path('logout/', logout, name='logout'),
    path('register/', registration, name='registration'),
    path('profile/', login_required(UserProfileView.as_view()),
         name='profile'),
    path('update-profile/<int:pk>/',
         login_required(UserUpdate.as_view()),
         name='update_profile'),
    path('change-password/',
         auth_views.PasswordChangeView.as_view(
             template_name='accounts/change_password.html',
             success_url=reverse_lazy('profile')),
         name='change_password'),
]
예제 #11
0
from django.urls import path

from accounts.views import SignInRequestView, SignInVerifyView, UserProfileView, UpdatePhotoView, ForgotPasswordView, \
    ResetPasswordView

urlpatterns = [
    path('sign-in-request', SignInRequestView.as_view()),
    path('sign-in-verify', SignInVerifyView.as_view()),
    path('profile', UserProfileView.as_view()),
    path('profile/photo', UpdatePhotoView.as_view()),
    path('forgot-password',
         ForgotPasswordView.as_view(),
         name='forgotPassword'),
    path('reset-password', ResetPasswordView.as_view(), name='resetPassword'),
]
예제 #12
0
from django.conf.urls import url
from django.contrib.auth import views as auth_views

from accounts.views import UserProfileView

urlpatterns = [
    url(r'^login/$',
        auth_views.login, {'template_name': 'accounts/login.html'},
        name='login'),
    url(r'^logout/$',
        auth_views.logout,
        name='logout',
        kwargs={'next_page': '/'}),
    url(r'^', UserProfileView.as_view(), name='user_profile'),
]
예제 #13
0
 path('product/<subcategory>/', ListView.as_view(), name='subcategory'),
 path('product/<subcategory>/<int:id>', DetailView.as_view(),
      name='detail'),
 path('cart/', include('cart.urls')),
 path('about/', AboutView.as_view(), name='about'),
 path('contact/', ContactView.as_view(), name='contact'),
 path('accounts/register/', RegisterView.as_view(), name='register'),
 path('accounts/login/', LoginView.as_view(), name='login'),
 path('accounts/reset-password/',
      PassordResetView.as_view(),
      name='reset-password'),
 path('accounts/register/email-confirmation',
      EmailConfirmation.as_view(),
      name='email_confirmation'),
 path('accounts/logout/', LogoutView.as_view(), name='logout'),
 path('accounts/<username>/', UserProfileView.as_view(), name='profile'),
 path('accounts/<username>/edit',
      ProfileEditView.as_view(),
      name='profile-edit'),
 path('accounts/<username>/history',
      UserHistoryView.as_view(),
      name='history'),
 path('accounts/<username>/addresses',
      UserAdressesView.as_view(),
      name='addresses'),
 path('accounts/<username>/change-password',
      ChangePasswordView.as_view(),
      name='change-password'),
 path('accounts/<username>/address-edit/<id>/',
      AddressEditView.as_view(),
      name='address-edit'),
예제 #14
0
# -*- coding: UTF-8 -*-
from django.urls import path
from accounts.views import UserRegistrationView, UserLoginView, UserProfileView, UserProfileEditView

urlpatterns = [
    path('new_user/', UserRegistrationView.as_view(),
         name='user_registration'),
    path('login/', UserLoginView.as_view(), name='login'),
    path('<int:pk>', UserProfileView.as_view(), name='user_profile'),
    path('<int:pk>/edit', UserProfileEditView.as_view(), name='user_edit'),
]
예제 #15
0
                            CustomPasswordResetConfirmView)

app_name = 'accounts'

urlpatterns = [
    path('register/', RegisterView.as_view(), name='register'),
    path('login/', CustomLoginView.as_view(), name='login'),
    path('forget-password/',
         CustomPasswordResetView.as_view(),
         name='forget_password'),
    re_path(
        r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        UserActivate.as_view(),
        name='activate'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('profile/<slug:username>/', UserProfileView.as_view(),
         name='profile'),
    path('password-change/',
         CustomPasswordChangeView.as_view(),
         name='password_change'),
    path('password-change-done/',
         PasswordChangeDone.as_view(),
         name='password_change_done'),
    path('password-reset-done/',
         PasswordResetDone.as_view(),
         name='password_reset_done'),
    path('password-reset-completed/',
         PasswordResetCompletedView.as_view(),
         name='password_reset_completed'),
    re_path(
        r'^password-reset-confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
예제 #16
0
파일: urls.py 프로젝트: phractal/phractal
 path("index/", IndexView.as_view()),
 path("login/", LoginView.as_view()),
 path("register/", RegisterView.as_view()),
 path("taskpub/", TaskpubView.as_view()),
 path("tasklist/", TasklistView.as_view()),
 path("myorder/", MyorderView.as_view()),
 path("personaldata/", PersonaldataView.as_view()),
 path("mynode/", MynodeView.as_view()),
 path("changepasswd/", ChangepasswdView.as_view()),
 path("wallet/", WalletView.as_view()),
 # path("node_num_manage/", NodeNumManageViewSet.as_view()),
 path("node_run_manage/", NodeRunManageViewSet.as_view()),
 # path("node_num_manage/", NodeNumManageViewSet.as_view()),
 path("node_num_manage/", Node_Management_List.as_view()),
 path("particular/", ParticularView.as_view()),
 path("userprofile/", UserProfileView.as_view()),
 path("wx_notify/", WxPayNotifyView.as_view()),
 path("withdraw/", WithdrawView.as_view()),
 path("bound/", WechatBound.as_view()),
 path("node_operate/", NodeOpViewSet.as_view()),
 path("create_node/", NodeCreateViewSet.as_view()),
 path("download/", NodeDownLoadViewSet.as_view()),
 path("nodetype/", NodeTypeViewSet.as_view()),
 path("node_management_list/", Node_Management_List.as_view()),
 path("weixinqrlogin/", WeiXinQRLogin.as_view()),
 path("authorization/", Authorization.as_view()),
 path("statistics/", StatisticsView.as_view()),
 path("globalstatistic/", NodeStatistic.as_view()),
 path("individualstatistic/", IndividualStatistic.as_view()),
 path("download_node/", DownloadView.as_view()),
 path("all_download_node/", AllDownloadNode.as_view()),
예제 #17
0
from django.urls import path
from accounts.views import LoginOrRegisterView, logout_view, UserProfileView, \
    MyPasswordChangeView, MyPasswordResetView, MyPassResetConfirmView, \
    add_or_remove_favorite, favorites_view

urlpatterns = [
    path('login/', LoginOrRegisterView.as_view(), name='login'),
    path('register/', LoginOrRegisterView.as_view(), name='register'),
    path('logout/', logout_view, name='logout'),
    path('profile/', UserProfileView.as_view(), name='profile'),
    path('password-change/', MyPasswordChangeView.as_view(), name='password_change'),
    path('pwd-reset/', MyPasswordResetView.as_view(), name='password_reset'),
    path('pwd-reset/<uidb64>/<token>/', MyPassResetConfirmView.as_view(), name='password_reset_confirm'),
    path('add_remove/<int:id>', add_or_remove_favorite, name='add_remove'),
    path('favorites/', favorites_view, name='favorites')
]
예제 #18
0
from listings.views import AllReviewsView, OwnerListingView, ListingCreateView,\
    ListingDetailView, ListingUpdateView, TicketSearchView, ListingDeleteView, \
    ReviewUserView, IndexView, transaction_update
from events.views import event_json, venue_json
from allauth.account.views import login
admin.autodiscover()

urlpatterns = [
    url(r'^$', IndexView.as_view(), name="home"),
    url(r'^accounts/login/$', login, name="login"), # login url for things that need it
    url(r'^accounts/', include('allauth.urls')),
    url(r'^verify_phone/$', PhoneVerificationView.as_view(), name="phone_verification"),
    url(r'^verify_phone/new/$', RequestNewVerificationCodeView.as_view(), name="new_verification_code"),
    url(r'^profile/$', OwnUserProfileView.as_view(), name="profile"),
    url(r'^profile/edit/$', ProfileUpdateView.as_view(), name="edit_profile"),
    url(r'^users/(?P<pk>[0-9]+)/$', UserProfileView.as_view(), name="profile_user"),
    url(r'^users/(?P<pk>[0-9]+)/reviews/$', AllReviewsView.as_view(), name="all_reviews_view"),
    url(r'^users/(?P<pk>[0-9]+)/listings/$', OwnerListingView.as_view(), name="owner_list_view"),
    url(r'^events/', include('events.event_urls')),
    url(r'^venues/', include('events.venue_urls')),

    url(r'^listings/$', TicketSearchView.as_view(), name="ticket_list"),
    url(r'^listings/create/$', ListingCreateView.as_view(), name="post"),
    url(r'^listings/(?P<pk>[0-9]+)/$',ListingDetailView.as_view(), name="ticket_view"),
    url(r'^listings/(?P<pk>[0-9]+)/edit/$',ListingUpdateView.as_view(), name="ticket_edit"),
    url(r'^listings/(?P<pk>[0-9]+)/delete/$',ListingDeleteView.as_view(), name="ticket_delete"),

    url(r'^reviews/(?P<transaction_id>[0-9]+)/create/$', ReviewUserView.as_view(), name="create_review"),

    url(r'^list/event/', event_json),
    url(r'^list/venue/', venue_json),