Example #1
0
def test_profile_view(rf, user):
    from accounts.views import ProfileView

    request = rf.get('/profile/')
    request.user = user
    view = ProfileView(request=request)
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username

    request = rf.get('/profile/abcd')
    request.user = user
    view = ProfileView(request=request)
    view.kwargs = {'username': user.username}
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username

    request = rf.get('/profile/1234')
    request.user = user
    view = ProfileView(request=request)
    view.kwargs = {'username': '******'}
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username
Example #2
0
 def setUp(self):
     self.factory = RequestFactory()
     view = ProfileView()
     self.request = self.factory.get(reverse('account_questionnaires'))
     self.user = create_new_user()
     self.request.user = self.user
     self.view = self.setup_view(view, self.request)
Example #3
0
 url(
     r"^artist/apply/thanks/?$",
     TemplateView.as_view(
         template_name="artist/artist_application_thanks.html"),
     name="artist_application_thanks",
 ),
 url(r"^artist/(?P<slug>[\w_-]+)/?$",
     ArtistDetailView.as_view(),
     name="artist"),
 url(
     r"^artist/(?P<artist_slug>[\w_-]+)/(?P<album_slug>[\w_-]+)/?$",
     AlbumDetailView.as_view(),
     name="album",
 ),
 url(r"^music/?$", MusicListView.as_view(), name="music"),
 url(r"^profile/?$", ProfileView.as_view(), name="profile"),
 url(
     r"^profile/(?P<username>[\w.@+-]+)/?$",
     PublicProfileView.as_view(),
     name="public_profile",
 ),
 url(r"^stats/?$", LeaderboardView.as_view(), name="leaderboard"),
 url(
     r"^artist-resources/?$",
     TemplateView.as_view(template_name="extra/artist-resources.html"),
     name="artist-resources",
 ),
 url(
     r"^terms/?$",
     TemplateView.as_view(template_name="extra/terms.html"),
     name="terms",
Example #4
0
from django.urls import path
from django.contrib.auth.views import LogoutView
from accounts.views import AccountsLoginView, SignupFormView, ProfileView

urlpatterns = [
    path('login/', AccountsLoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(next_page='/'), name='logout'),
    path('signup/', SignupFormView.as_view(), name='signup'),
    path('profile/', ProfileView.as_view(), name='profile'),
]
Example #5
0
    # Notes
    url(r'^notes/(?P<username>[\w.+-]+)?$', UserNotesView.as_view(), name='user_notes'),
    url(r'^course/(?P<course_slug>[-a-zA-Z0-9_]+)/mynotes/$', CourseNotesView.as_view(), name='user_course_notes'),

    # Messages
    url(r'^course/(?P<course_slug>[-a-zA-Z0-9_]+)/messages/$', GenericCourseView.as_view(template_name="messages.html"), name='messages'),
    url(r'^course/(?P<course_slug>[-a-zA-Z0-9_]+)/message/(?P<message_id>[1-9][0-9]*)$', GenericCourseView.as_view(template_name="message.html"), name='message_detail'),

    # Reports
    url(r'^course/(?P<course_slug>[-a-zA-Z0-9_]+)/reports/$', GenericCourseView.as_view(template_name="administration/stats.html"), name='reports'),

    # Authentication
    url(r'^logout/', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='timtec_logout'),

    url(r'^profile/edit/?$', ProfileEditView.as_view(), name="profile_edit"),
    url(r'^profile/(?P<username>[\w.+-]+)?/?$', ProfileView.as_view(), name="profile"),

    # The django-allauth
    url(r'^accounts/', include('allauth.urls')),
    url(r'^api/user_search/?$', UserSearchView.as_view(), name='user_search'),
    url(r'^api/student_search/?$', StudentSearchView.as_view(), name='student_search'),

    url(r'^pages(?P<url>.*)$', FlatpageView.as_view(), name='flatpage'),

    # The django-rosetta
    url(r'^rosetta/', include('rosetta.urls')),

    url(r'^markdown/', include('django_markdown.urls')),

)
Example #6
0
    # url(r'^accounts/password/reset/done/$', password_reset_done, name='password_reset_done'),
    # url(r'^accounts/password/reset/done/$', password_reset_done(template_name="account/email/password_reset_done.html"), name='password_reset_done'),
    # url(r'^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>,+)/$', password_reset_confirm, name='password_reset_confirm'),
    url(r'^logout/', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='timtec_logout'),

    url(r'^dashboard/', TemplateView.as_view(template_name="dashboard.html")),
    url(r'^forum/', TemplateView.as_view(template_name="forum.html"), name='forum'),
    url(r'^thread/', TemplateView.as_view(template_name="forum-thread.html")),
    url(r'^login/', TemplateView.as_view(template_name="login.html")),
    url(r'^register/', TemplateView.as_view(template_name="register.html")),
    url(r'^flatpage/', TemplateView.as_view(template_name="flatpage.html")),

    url(r'^profile/edit/?$', ProfileEditView.as_view(), name="profile_edit"),
    url(r'^profile/edit/social/?$', UserSocialAccountCreateView.as_view(), name="profile_edit_add_social"),
    url(r'^profile/edit/social/(?P<pk>[1-9][0-9]*)/?$', UserSocialAccountDeleteView.as_view(), name="profile_edit_delete_social"),
    url(r'^profile/(?P<username>[\w.+-]+)?/?$', ProfileView.as_view(), name="profile"),

    # The django-allauth
    url(r'^accounts/', include('allauth.urls')),
    url(r'^api/user_search/?$', UserSearchView.as_view(), name='user_search'),
    url(r'^api/student_search/?$', StudentSearchView.as_view(), name='student_search'),

    url(r'^pages(?P<url>.*)$', FlatpageView.as_view(), name='flatpage'),

    # The django-rosetta
    url(r'^rosetta/', include('rosetta.urls')),

    url(r'^markdown/', include('django_markdown.urls')),

    url(r'^djangular.js',
        TemplateView.as_view(template_name='djangular.js', content_type='text/javascript'),
Example #7
0
from django.contrib.auth.decorators import login_required, permission_required
from django.conf.urls.defaults import patterns, include, url
from accounts.views import ProfileView, ActivityListView, ActivityDetailView

urlpatterns = patterns('accounts.views',
                       url(r'^profile/$',
                           login_required(ProfileView.as_view()),
                           name='profile'
                           ),

                       url(r'^activity/$',
                           login_required(ActivityListView.as_view()),
                           name='activities'),

                       url(r'^activity/(?P<pk>\d+)$',
                           login_required(ActivityDetailView.as_view()),
                           name='activity-detail'),
                       )

urlpatterns += patterns('',
                       (r'^login/$', 'django.contrib.auth.views.login',
                        {'template_name': 'accounts/login.html'},
                        "login"
                        ),

                       (r'^logout/$', 'django.contrib.auth.views.logout',
                        {'template_name': 'accounts/logout.html'},
                        "logout",
                        ),

                       (r'^changepasswd/$', 'django.contrib.auth.views.password_change',
Example #8
0
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.urls import path, include

from accounts.views import RegistrationView, login_page, ProfileView, HomeView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name='home'),
    path('hospital/', include(('hospitals.urls', 'hospital'))),
    path('patient/', include(('patients.urls', 'patient'))),
    path('register/', RegistrationView.as_view(), name='register'),
    path('login/', login_page, name='login'),
    path('profile-update', ProfileView.as_view(), name='profile-update'),
    path('admin_panel/hospitals/', include(('hospitals.urls', 'hospital'))),
    path('admin_panel/requests/', include(('requests.urls', 'request'))),
]

from django.conf import settings
from django.conf.urls.static import static

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Example #9
0
File: urls.py Project: USEPA/TRACI
- Password Management
- Username management
"""

from django.conf.urls import url
from accounts.views import login, logout, ProfileView, UserRegistrationView, \
    UserApprovalView, UserDenialView, PasswordResetRequestView, \
    PasswordResetConfirmView, UsernameReminderRequestView

urlpatterns = [
    # login
    url(r'^login/$', login, name='login'),
    url(r'^logout/$', logout, name='logout'),

    # view/edit existing profile
    url(r'^profile/$', ProfileView.as_view(), name='profile'),

    # new user registration
    url(r'^register/$', UserRegistrationView.as_view(), name='register'),
    # Give admins a chance to approve or deny new users, taken from Greenscope
    url(r'^register/approve/(?P<uidb64>[0-9A-Za-z]+)/$',
        UserApprovalView.as_view(),
        name='register_approve'),
    url(r'^register/deny/(?P<uidb64>[0-9A-Za-z]+)/$',
        UserDenialView.as_view(),
        name='register_deny'),
    # url(r'^register/activate/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
    #    UserActivationView.as_view(), name='register_activate'),

    # password management
    url(r'^password/reset/$',
Example #10
0
# coding: utf-8
from django.conf.urls import patterns, url
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required, user_passes_test

from accounts.views import (
    RegistrationView,
    LoginView,
    LogOut,
    ProfileView,
    ProfileSettingsView,
    ProfileAccessView,
    ProfileModelsListView,
)


urlpatterns = patterns(
    u"accounts.views",
    url(r"^register/$", RegistrationView.as_view(), name=u"registration"),
    url(r"^login/$", LoginView.as_view(), name=u"login"),
    url(r"^logout/$", LogOut.as_view(), name=u"logout"),
    url(r"^profile/$", login_required(ProfileView.as_view()), name=u"profile"),
    url(r"^profile/settings/$", login_required(ProfileSettingsView.as_view()), name=u"profile_settings"),
    url(r"^profile/access/$", login_required(ProfileAccessView.as_view()), name=u"profile_access"),
    url(r"^profile/models_list/$", login_required(ProfileModelsListView.as_view()), name=u"profile_models_list"),
)
Example #11
0
def test_profile_view(rf, user):
    from accounts.views import ProfileView

    request = rf.get('/profile/')
    request.user = user
    view = ProfileView(request=request)
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username

    request = rf.get('/profile/abcd')
    request.user = user
    view = ProfileView(request=request)
    view.kwargs = {'username': user.username}
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username

    request = rf.get('/profile/1234')
    request.user = user
    view = ProfileView(request=request)
    view.kwargs = {'username': '******'}
    response = view.get(request)
    assert response.status_code == 200
    assert response.context_data['profile_user'].username == user.username
Example #12
0
from django.urls import path, include
from django.contrib.auth.decorators import login_required
from accounts.views import (
    SignInView,
    SignOutView,
    SignUpView,
    ProfileView,
    )


urlpatterns = [
    path('signin/', SignInView.as_view(), name='signin_view'),
    path('signout/', login_required(SignOutView.as_view()), name='signout_view'),
    path('signup/', SignUpView.as_view(), name='signup_view'),
    path('profile/', login_required(ProfileView.as_view()), name='profile_view'),
]
from django.urls import path, include
from django.conf import settings

# email varification
from accounts.views import SignUpView, ProfileView, ActivateAccount

urlpatterns = [
    path('signup/', SignUpView.as_view(), name='signup'),
    path('profile/<int:pk>/', ProfileView.as_view(), name='profile'),
    path('activate/<uidb64>/<token>/',
         ActivateAccount.as_view(),
         name='activate'),
    # path('')
]
Example #14
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.contrib import admin
from django.urls import path, include
from donation.views import LandingPage,AddDonation, FormConfirmationView, ArchiveDonation, SingleDonation
from accounts.views import Login, Logout, Register, ProfileView, ChangePassword, EditProfile

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', LandingPage.as_view(), name="url_landing_page"),
    path('add/', AddDonation.as_view(), name="url_add_donation"),
    path('login/', Login.as_view(), name="url_login"),
    path('logout/', Logout.as_view(), name="url_logout"),
    path('register/', Register.as_view(), name="url_register"),
    path('accounts/', include("django.contrib.auth.urls")),
    path('profile/', ProfileView.as_view(), name="url_profile"),
    path('add/confirmation/', FormConfirmationView.as_view(), name="url_confirmation"),
    path('profile/change/', ChangePassword.as_view(), name="url_change"),
    path('profile/edit/', EditProfile.as_view(), name="url_edit"),
    path('archive-donations/<int:donation_id>/', ArchiveDonation.as_view(), name="url_archive"),
    path('donation/<int:pk>/', SingleDonation.as_view(), name="url_donation"),
]
Example #15
0
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('pazar.urls')),
    path('blog/', include('blog.urls')),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('account/', include('accounts.urls')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('sent/', activation_sent_view, name="activation_sent"),
    path('activate/<slug:uidb64>/<slug:token>/', activate, name='activate'),
    path('accounts/', include('allauth.urls')),
    path('change-password/',
         auth_views.PasswordChangeView.as_view(
             template_name='pazar/change-password.html', success_url='home'),
         name='change-password'),
    path('edit-profile/', ProfileEditView.as_view(), name="edit-profile"),
    path('profile/<int:id>/<slug:slug>', ProfileView.as_view(),
         name="profile"),
    path('password_change/',
         auth_views.PasswordChangeView.as_view(),
         name="password_change"),
    path('password_change/done',
         auth_views.PasswordChangeDoneView.as_view(),
         name="password_change_done"),
    path('password_reset/',
         auth_views.PasswordResetView.as_view(),
         name='password_reset'),
    path('password_reset/done/',
         auth_views.PasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         auth_views.PasswordResetConfirmView.as_view(),
Example #16
0
from django.contrib import admin
from django.urls import path
from accounts.views import MyProfileView, ProfileView

urlpatterns = [
    path('', MyProfileView.as_view(), name="my-profile"),
    path('<slug:slug>', ProfileView.as_view(), name="view-profile"),
]
Example #17
0
from django.conf.urls import url, patterns
from accounts.views import RegisterView, ProfileView, LoginView, LogoutView,RegisterSuccessView,EditProfileView,FollowUser

urlpatterns=patterns('',
    url(r'^register/$',RegisterView.as_view(),name="register"),
    url(r'^registersuccess/$',RegisterSuccessView.as_view(),name="register_success"),
    url(r'^login/$',LoginView.as_view(), name="login"),
    url(r'^logout/$', LogoutView.as_view(), name="logout"),
    url(r'^profile/(?P<username>[-\w\d]+)/$',ProfileView.as_view(),name="profile"),
    url(r'^profile/$',ProfileView.as_view(),name="myprofile"),
    url(r'^changepassword/$',ProfileView.as_view(),name="change_password"),
    url(r'^editprofile/$',EditProfileView.as_view(),name="edit_profile"),
    url(r'^follow/$',FollowUser.as_view())
)
Example #18
0
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required

from accounts.views import ProfileView, RemoveUploadView, ImageView


urlpatterns = patterns('',
    url(r'^$', login_required(TemplateView.as_view(template_name='home.html')), name='home'),
    url(r'^profile/$', ProfileView.as_view(), name='profile'),
    url(r'^profile/upload/$', 'accounts.views.upload_file', name='upload'),
    url(r'^profile/removefile/(?P<pk>\d+)/$', RemoveUploadView.as_view(), name='file_remove'),
	url(r'^profile/image/(?P<pk>\d+)/$', ImageView.as_view(), name='image_view'),

    url(r'^accounts/', include('allauth.urls')),
    url(r'^admin/', include(admin.site.urls)),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


Example #19
0
from django.urls import path
from accounts.views import JoinView, AuthorsView, UserLoginView, UserLogoutView, ProfileView, ProfileUpdateView

from django.views.generic import RedirectView
# RedirectView will redirect url--> www.google.com/accounts/ to www.google.com/accounts/login/

app_name = 'accounts'
urlpatterns = [
    path('', RedirectView.as_view(url='login/', permanent=True)),
    path('join/', JoinView.as_view(), name='join'),
    path('authors/', AuthorsView.as_view(), name='authors'),
    path('profile/<str:username>/', ProfileView.as_view(), name='profile'),
    path('profile/<str:username>/update/',
         ProfileUpdateView.as_view(),
         name='profile_update'),
    path('login/', UserLoginView.as_view(), name='login'),
    path('logout/', UserLogoutView.as_view(), name='logout'),
]
Example #20
0
from django.urls import path
from django.contrib.auth.views import LogoutView

from accounts.views import RegisterView, LoginUserView, ProfileView, CustomPasswordResetConfirmView, ResetPassword, ThePasswordChangeView, EditProfileView

app_name = 'accounts'

urlpatterns = [
    path('register/', RegisterView.as_view(), name='register'),
    path('login/', LoginUserView.as_view(), name='login'),
    path('user-profile/<int:pk>', ProfileView.as_view(), name='user-profile'),
    path('log-out', LogoutView.as_view(), name='log-out'),
    path('reset-password', ResetPassword.as_view(), name='reset-password'),
    path('change-password', ThePasswordChangeView.as_view(), name='change-password'),
    path('edit-profile/<int:pk>/', EditProfileView.as_view(), name='edit_profile'),
    path('password-reset-confirm/<str:uidb64>/<str:token>/', CustomPasswordResetConfirmView.as_view(), name = 'password-reset-confirm'),
]
Example #21
0
from django.urls import path, include

from accounts.views import MyTokenObtainPairView, UserCreate, ProfileView, profile_detail_view, get_profile_view, \
    user_follow_view

urlpatterns = [
    path('token', MyTokenObtainPairView.as_view(), name="token"),
    path('register', UserCreate.as_view(), name="register"),
    path('profile', get_profile_view, name="get-profile"),
    path('profile/update', ProfileView.as_view(), name="profile-update"),
    path('profile/<str:username>',
         profile_detail_view,
         name="profile-detail-view"),
    path('profile/<str:username>/follow',
         user_follow_view,
         name="profile-follow"),
]
Example #22
0
File: urls.py Project: USEPA/HELP
Available functions:
- Login
- View/edit profile
- New user registration
- Password Management
- Username management
"""

from django.conf.urls import url
from accounts.views import login, logout, ProfileView, UserRegistrationView, UserApprovalView, UserDenialView, \
    PasswordResetRequestView, PasswordResetConfirmView, UsernameReminderRequestView

app_name = 'accounts'

urlpatterns = [
    url(r'^$', ProfileView.as_view(), name='accounts_index'),
    url(r'^index/$', ProfileView.as_view(), name='accounts_index'),
    url(r'^profile/$', ProfileView.as_view(), name='profile'),
    url(r'^login/$', login, name='login'),
    url(r'^logout/$', logout, name="logout"),

    # new user registration
    url(r'^register/$', UserRegistrationView.as_view(), name='register'),
    # Give admins a chance to approve or deny new users, taken from Greenscope
    url(r'^register/approve/(?P<uidb64>[0-9A-Za-z]+)/$',
        UserApprovalView.as_view(),
        name='register_approve'),
    url(r'^register/deny/(?P<uidb64>[0-9A-Za-z]+)/$',
        UserDenialView.as_view(),
        name='register_deny'),
    # url(r'^register/activate/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
Example #23
0
#from filesManagement.views import ShowFile
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from TFT_project.views import LinkView

admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^/', HomePageView.as_view()),
    url(r'^accounts/(?P<username>[\.\w-]+)/edit/$', profile_edit, name='userena_profile_edit'),
    url(r'^accounts/(?P<username>[\.\w-]+)/password/$', userena_views.password_change, {'success_url':'/'}),
    url(r'^accounts/signin', userena_views.signin),
    url(r'^accounts/signup', signup,{'success_url':'/'}),
    url(r'^accounts/signout', userena_views.signout),
    url(r'^accounts/(?P<username>[\.\w-]+)/$', profile_detail, name='userena_profile_detail'),
    url(r'^accounts/view/(?P<pk>\d+)', ProfileView.as_view()),
	url(r'^accounts/', include('userena.urls')),
    url(r'^ckeditor/', include('ckeditor.urls')),
	url(r'^admin/', include(admin.site.urls)),
	url(r'^posts/', include('posts.urls',namespace = "post")),
    url(r'^pastpost_discuss/', PastPostDiscuss.as_view()),
    url(r'^pastpost_file/', PastPostFile.as_view()),
    url(r'^link', LinkView.as_view()),
    url(r'^files/', include('filesManagement.urls')),
    url(r'^teacher/oneonone', TeacherInfoOneOnOneView.as_view()),
    url(r'^teacher/nwmentor', TeacherInfoNwMentorView.as_view()),
    url(r'^$', login_required(HomePageView.as_view()), name='main_base.html'),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# Add media and static files
urlpatterns += staticfiles_urlpatterns()
Example #24
0
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.contrib import admin
from django.urls import path, include
# from django.contrib.auth.views import LogoutView
from django.conf.urls.static import static
from django.conf import settings
from accounts.views import LoginView, RegisterView, ProfileView, LogoutView, upload


urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/',include('accounts.api.urls')),
    path('login/', LoginView.as_view(), name='login'),
    path('upload/', upload, name='upload'),
    path('logout/',LogoutView.as_view(), name='logout'),
    path('accounts/profile/', ProfileView.as_view(), name='profile'),
    path('register/', RegisterView.as_view(), name='register')
] + static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Example #25
0
from django.urls import path
from accounts.views import ProfileView, UserHomeRedirectView, ProfileUpdateView


urlpatterns = [
    path('<int:pk>/<slug:username>/', ProfileView.as_view(), name='my_profile'),
    path('update/<int:pk>/<slug:username>/', ProfileUpdateView.as_view(), name='update_profile'),
    path('redirect', UserHomeRedirectView.as_view(), name='redirect')
]
Example #26
0
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy

from accounts.views import ProfileView, SearchView, RegisterFormView, EmailLoginView, GuestProfileView, logout, \
    AvatarFormView, UserProfileInfoView, FriendsView, InviteToFriends, ConfirmInvitation

urlpatterns = [
    url(r'^search/$', SearchView.as_view(), name="profiles-search"),
    url(r'^profile/$', ProfileView.as_view(), name="profile"),
    url(r'^avatar-upload/$', AvatarFormView.as_view(), name="avatar-upload"),
    url(r'^profile-info/$',
        UserProfileInfoView.as_view(),
        name="user-profile-info"),
    url(r'^profile/(?P<pk>[0-9]+)/$',
        GuestProfileView.as_view(),
        name="guest-profile"),
    url(r'^friends/$', FriendsView.as_view(), name="profile-friends"),
    url(r'^friends/invite/(?P<pk>[0-9]+)/$',
        InviteToFriends.as_view(),
        name="invite-to-friends"),
    url(r'^friends/confirm-invitation/(?P<pk>[0-9]+)/$',
        ConfirmInvitation.as_view(),
        name="confirm-invitation"),
    url(r'^login/$', EmailLoginView.as_view(), name="login"),
    url(r'^register/$', RegisterFormView.as_view(), name="register"),
    url(r'^logout/$', logout, name="logout"),
]
Example #27
0
    url(r'^forum/',
        TemplateView.as_view(template_name="forum.html"),
        name='forum'),
    url(r'^thread/', TemplateView.as_view(template_name="forum-thread.html")),
    url(r'^login/', TemplateView.as_view(template_name="login.html")),
    url(r'^register/', TemplateView.as_view(template_name="register.html")),
    url(r'^flatpage/', TemplateView.as_view(template_name="flatpage.html")),
    url(r'^profile/edit/?$', ProfileEditView.as_view(), name="profile_edit"),
    url(r'^profile/edit/social/?$',
        UserSocialAccountCreateView.as_view(),
        name="profile_edit_add_social"),
    url(r'^profile/edit/social/(?P<pk>[1-9][0-9]*)/?$',
        UserSocialAccountDeleteView.as_view(),
        name="profile_edit_delete_social"),
    url(r'^profile/(?P<username>[\w.+-]+)?/?$',
        ProfileView.as_view(),
        name="profile"),

    # The django-allauth
    url(r'^accounts/', include('allauth.urls')),
    url(r'^api/user_search/?$', UserSearchView.as_view(), name='user_search'),
    url(r'^api/student_search/?$',
        StudentSearchView.as_view(),
        name='student_search'),
    url(r'^pages(?P<url>.*)$', FlatpageView.as_view(), name='flatpage'),

    # The django-rosetta
    url(r'^rosetta/', include('rosetta.urls')),
    url(r'^markdown/', include('django_markdown.urls')),
    url(r'^djangular.js',
        TemplateView.as_view(template_name='djangular.js',
Example #28
0
"""cop4710 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
from accounts.views import SignupView, LoginView, LogoutView, ProfileView, redirect_to_default_user_profile

urlpatterns = [
    path("signup/", SignupView.as_view(), name="accounts_signup"),
    path("login/", LoginView.as_view(), name="accounts_login"),
    path("logout/", LogoutView.as_view(), name="accounts_logout"),
    path("<pk>/", ProfileView.as_view(), name="accounts_view"),
    path("", redirect_to_default_user_profile),
]
Example #29
0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from django.conf.urls import include, url
from django.views.generic import TemplateView
from accounts.views import (
    ProfileView,
)

urlpatterns = [
    url(r'^logout/$',
        'django.contrib.auth.views.logout',
        {'next_page': '/'}),

    url(r'^',
        include('allauth.urls')),

    url(r'^profile/',
        ProfileView.as_view(),
        name='profile'),

    url(r'^matches/',
        TemplateView.as_view(template_name='account/matches.html'),
        name='matches'),
]
Example #30
0
from accounts.views import ProfileView, SignupWizard
from accounts.forms import UserCreationForm_1, UserCreationForm_identity_info, UserCreationForm_contact_info

urlpatterns = patterns('accounts.views',
                       #url(r'^signup/$', 'create_user'),
                       url(r'^signup/done/$', 'user_creation_done', name = 'signup_done'),
                       
                       url(r'^signup/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 
                        'signup_confirm'),

                       url(r'^signup/complete/$', 'signup_complete'),
                       url(r'^denied/$',
                           TemplateView.as_view(
                               template_name="registration/access_denied.html")),
                       url(r'^profile/$', ProfileView.as_view()),
                       url(r'^profile/edit/$', 'edit_user_information'),
                       url(r'^signup/step2/$', 'identityinfo', name="signup_step2"),
                       url(r'^signup/step3/$', 'contactinfo', name="signup_step3"),
                       url(r'^signup/$', SignupWizard.as_view([UserCreationForm_1, UserCreationForm_identity_info, UserCreationForm_contact_info])),

    )

urlpatterns += patterns('django.contrib.auth.views',
                       (r'^login/$', 'login'),
                       (r'^logout/$', 'logout'),
                       (r'^logout_then_login/$', 'logout_then_login'),
                       (r'^password_change/$', 'password_change'),
                       (r'^password_change/done/$', 'password_change_done'),
                       
                       (r'^password_reset/$', 'password_reset'),