Ejemplo n.º 1
0
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', MessageListView.as_view(), name='message-list'),
    url(r'^u/(?P<username>[a-zA-Z0-9]+)/$',
        MessageCreateView.as_view(),
        name='message-create'),
    url(r'^login/$', views.LoginView.as_view(), name='account_login'),
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
    url(r'^password_change/$',
        views.PasswordChangeView.as_view(),
        name='password_change'),
    url(r'^password_change/done/$',
        views.PasswordChangeDoneView.as_view(),
        name='password_change_done'),
    url(r'^password_reset/$',
        views.PasswordResetView.as_view(),
        name='password_reset'),
    url(r'^password_reset/done/$',
        views.PasswordResetDoneView.as_view(),
        name='password_reset_done'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        views.PasswordResetConfirmView.as_view(),
        name='password_reset_confirm'),
    url(r'^reset/done/$',
        views.PasswordResetCompleteView.as_view(),
        name='password_reset_complete'),
    url(r'^accounts/signup/$', SignupView.as_view()),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Ejemplo n.º 2
0
from django.urls import path, re_path
from allauth.account.views import LogoutView, SignupView
from .views import (
    CustomPasswordResetView, CustomPasswordResetDoneView,
    CustomPasswordResetConfirmView, CustomPasswordResetCompleteView
)
from allauth.account.views import email_verification_sent, confirm_email


urlpatterns = [
    path('logout/', LogoutView.as_view(), name='account_logout'),
    path('cadastro/', SignupView.as_view(), name='account_signup'),
    path('password_reset/', CustomPasswordResetView.as_view(), name='password_reset'),
    path('password_reset/done/', CustomPasswordResetDoneView.as_view(), name='password_reset_done'),
    path('reset/<uidb64>/<token>/', CustomPasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('reset/done/', CustomPasswordResetCompleteView.as_view(), name='password_reset_complete'),
    path("confirm-email/", email_verification_sent, name="account_email_verification_sent"),
    re_path(r"^confirm-email/(?P<key>[-:\w]+)/$", confirm_email, name="account_confirm_email"),
]
Ejemplo n.º 3
0
 def test_signup_view(self):
     view = resolve('/accounts/signup/')
     self.assertEqual(view.func.__name__, SignupView.as_view().__name__)
Ejemplo n.º 4
0
from django.conf.urls.static import static
from django.conf.urls import url, include

from allauth.account.views import LoginView, SignupView, LogoutView
from games import views
from users.views import user_profile_view, pay_thankyou_view, user_profile_edit


urlpatterns = [
    path('', views.game_list_view, name='game_list'),
    path('game_details/<int:game_id>',
         views.game_details_view, name='game_details'),
    path('add_comment', views.add_comment, name='add_comment'),
    path('edit_comment', views.edit_comment, name='edit_comment'),
    path('delete_comment', views.delete_comment, name='delete_comment'),
    path('login', LoginView.as_view(), name='login'),
    path('logout', LogoutView.as_view(), name='logout'),
    path('signup', SignupView.as_view(), name='signup'),
    path('userprofile', user_profile_view, name='userprofile'),
    path('userprofile_edit', user_profile_edit, name='userprofile_edit'),
    path('pay_thankyou', pay_thankyou_view, name='pay_thankyou'),
    path('accounts/', include('allauth.urls')),
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Ejemplo n.º 5
0
from django.urls import path, include
from core.views import *
from allauth.account.views import LoginView, SignupView, LogoutView

app_name = 'core'
urlpatterns = [
    path('', HomeView.as_view(), name='home'),
    path('product/<slug>/', ItemDetailView.as_view(), name='product'),
    path('checkout/', CheckoutView.as_view(), name='checkout'),
    path('order_summary/', OrderSummaryView.as_view(), name='order_summary'),
    path('add_to_cart/<slug>/', add_to_cart, name='add_to_cart'),
    path('remove_from_cart/<slug>/', remove_from_cart,
         name='remove_from_cart'),
    path('remove_single_item_from_cart/<slug>/',
         remove_single_item_from_cart,
         name='remove_single_item_from_cart'),
    path('payment/<payment_option>/', PaymentView.as_view(), name='payment'),
    path('add_coupon/', AddCouponView.as_view(), name='add_coupon'),
    path('request_refund/', RequestRefundView.as_view(),
         name='request_refund'),
    path('accounts/login/', LoginView.as_view(), name='account_login'),
    path('accounts/logout/', LogoutView.as_view(), name='account_logout'),
    path('accounts/signup/', SignupView.as_view(), name='account_signup'),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Ejemplo n.º 6
0
    PasswordResetDoneView,
    PasswordResetFromKeyDoneView,
)

from .api import router

logged_users_redirect = user_passes_test(lambda u: u.is_anonymous, "/")

urlpatterns = [
    path("", include("app.urls")),
    path("api-v1/", include(router.urls)),
    path("api-auth/", include("rest_auth.urls")),
    path("api-auth/registration/", include("rest_auth.registration.urls")),
    path(
        "users/signup",
        SignupView.as_view(template_name="registration/signup.html"),
        name="account_signup",
    ),
    path(
        "users/login",
        logged_users_redirect(
            LoginView.as_view(template_name="registration/login.html")),
        name="account_login",
    ),
    path(
        "users/logout",
        LogoutView.as_view(template_name="registration/logout.html"),
        name="account_logout",
    ),
    path(
        "users/reset",
Ejemplo n.º 7
0
from django.urls import path, include
from allauth.account.views import SignupView, LoginView, LogoutView

# app_name = "users"
urlpatterns = [
    path("signin/", LoginView.as_view(), name="account_login"),
    path("signup/", SignupView.as_view(), name="account_signup"),
    path("signout/", LogoutView.as_view(), name="account_logout"),
]
Ejemplo n.º 8
0
    def test_redemption_by_unauthed_user(self):
        """Redemption on triggers on user signup."""
        email = '*****@*****.**'
        with self.assertRaises(User.DoesNotExist):
            User.objects.get(email=email)
        invite = get(
            TeamInvite, email=email, team=self.team,
            organization=self.organization,
        )
        team_member = get(
            TeamMember,
            invite=invite,
            member=None,
            team=self.team,
        )

        req = self.request(
            'get',
            '/organizations/invite/{}/redeem'.format(invite.hash),
        )
        view = public_views.UpdateOrganizationTeamMember.as_view()
        view(req, hash=invite.hash)

        self.assertEqual(team_member.invite, invite)
        self.assertIsNone(team_member.member)
        self.assertEqual(req.session['invite'], invite.pk)
        self.assertEqual(req.session['invite:allow_signup'], True)
        self.assertEqual(req.session['invite:email'], email)

        # This cookie makes the EmailAddress be verified after signing up with
        # the same email address the user was invited. This is done
        # automatically by django-allauth
        self.assertEqual(req.session['account_verified_email'], email)

        session = req.session

        # Test signup view
        req = self.request(
            'post',
            '/accounts/signup',
            data={
                'username': '******',
                'email': email,
                'password1': 'password',
                'password2': 'password',
                'confirmation_key': 'foo',
            },
            session=session,
        )
        resp = SignupView.as_view()(req)

        self.assertEqual(resp.status_code, 302)

        ret_teammember = TeamMember.objects.get(member__email=email)
        self.assertIsNone(ret_teammember.invite)
        self.assertEqual(ret_teammember, team_member)
        with self.assertRaises(TeamInvite.DoesNotExist):
            TeamInvite.objects.get(pk=invite.pk)

        self.assertTrue(
            User.objects.get(email=email)
            .emailaddress_set.filter(verified=True)
            .exists()
        )
Ejemplo n.º 9
0
def mock_signup_form(request):
    signup_view = SignupView()
    signup_view.request = request
    signup_view.template_name = "account/signup_short.html"
    return signup_view.get(request).render().content
Ejemplo n.º 10
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.views.defaults import page_not_found
from django.http import Http404
#from cjworkbench.views.signup import SignupView
from allauth.account.views import SignupView

urlpatterns = [
    url(r'^admin/?', admin.site.urls),
    url(r'^xyzzy/signup/$', SignupView.as_view(), name='account_signup'),
    url(r'^account/signup/$', page_not_found,  {'exception': Http404()}),
    url(r'^account/', include('allauth.urls')),
    url(r'^', include('server.urls')),
]
Ejemplo n.º 11
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from allauth.account.views import SignupView
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView

urlpatterns = [
    url(r"^admin/?", admin.site.urls),
    url(r"^account/signup/$", SignupView.as_view(), name="account_signup"),
    url(
        r"^xyzzy/signup/$",
        RedirectView.as_view(url="/account/signup/", permanent=True),
        name="account_signup",
    ),
    url(r"^account/", include("allauth.urls")),
    url(r"^", include("server.urls")),
]
Ejemplo n.º 12
0
"""project 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, include
from allauth.account.views import SignupView, LoginView, LogoutView
from . import views
from users import urls

app_name = 'users'
urlpatterns = [
    path('signup', SignupView.as_view(),
         name="account_signup"),  # account_signup
    path('login', LoginView.as_view(), name="account_login"),  #  account_login
    path('logout', LogoutView.as_view(),
         name="account_logout"),  # account_logout
    path('mypage', views.mypage, name="mypage"),
    path('coin_add/<int:amount>', views.coin_add, name="coin_add"),
    path('coin_sub/<int:amount>', views.coin_sub, name="coin_sub"),
]
Ejemplo n.º 13
0
    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 allauth.account.views import SignupView

from users.forms import CustomUserForm

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/register',
         SignupView.as_view(form_class=CustomUserForm, success_url='/'),
         name='django_registration_register'),
    path('accounts/', include('allauth.urls')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('api/', include('users.api.urls')),
    path('api/', include('giphy.api.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('api/rest-auth/', include('rest_auth.urls')),
    path('api/rest-auth/registration/',
         include('rest_auth.registration.urls')),
    path('', include('frontend.urls')),
]
from django.urls import path, include
from .Views import site, provider
from . import views
from allauth.account.views import SignupView

urlpatterns = [
    path('', views.Homeview.as_view(), name='Home'),
    path('search/', views.SearchView.as_view(), name='search_results'),
    path('accounts/signup/', site.Signup.as_view(), name='Signup'),
    path('accounts/signup/tourist/',
         SignupView.as_view(),
         name='Tourist_signup'),
    path('accounts/signup/service/', provider.Service, name='Service'),
    path('accounts/', include('allauth.urls')),
    path('events/list/', views.EventListView.as_view(), name='list'),
    path('events/create/', views.EventCreateView.as_view(), name='create'),
    path('events/update/<int:pk>/',
         views.EventUpdateView.as_view(),
         name='update'),
    path('events/delete/<int:pk>/',
         views.EventDeleteView.as_view(),
         name='delete'),
    path('event/view/<int:pk>/', views.EventDetailView.as_view(), name='view'),
    path('booking/list/', views.BookListView.as_view(), name='book_list'),
    path('booking/create/<int:pk>',
         views.BookCreateView.as_view(),
         name='book_create'),
    path('booking/delete/<int:pk>/',
         views.BookDeleteView.as_view(),
         name='book_delete'),
    path('api/search/', views.EventAPIView),
Ejemplo n.º 15
0
def mock_signup_form(request):
    signup_view = SignupView()
    signup_view.request = request
    signup_view.template_name = "account/signup_short.html"
    return signup_view.get(request).render().content
Ejemplo n.º 16
0
    # register urls
    # url(r'^register/$', views.register, name='register'),

    # password reset
    # url(r'^password-reset/$', DjangoPasswordResetView.as_view(form_class=UserPasswordResetForm, success_url=reverse_lazy('appaccounts:password_reset_done')), name='password_reset'),
    # url(r'^password-reset/done/$', DjangoPasswordResetDoneView.as_view(template_name='registration/password_reset_done.html'), name='password_reset_done'),
    # url(r'^password-reset/confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$', DjangoPasswordResetConfirmView.as_view(form_class=UserSetPasswordForm, success_url=reverse_lazy('appaccounts:password_reset_complete')), name='password_reset_confirm'),
    # url(r'^password-reset/complete/$', DjangoPasswordResetCompleteView.as_view(), name='password_reset_complete'),

    ###################
    # Auth urls by AllAuth
    ###################

    # register urls
    url(r'^register/$',
        SignupView.as_view(form_class=AllAuthSignupForm,
                           template_name='appaccounts/register.html'),
        name='register'),

    # password reset
    url(r'^password/reset/$',
        AllAuthPasswordResetView.as_view(form_class=AllAuthResetPasswordForm),
        name="password_reset"),
    url(r'^password/reset/done/$',
        AllAuthPasswordResetDoneView.as_view(),
        name="account_reset_password_done"),
    # url(r'^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$', AllAuthPasswordResetFromKeyView.as_view(form_class=AllAuthResetPasswordKeyForm), name="account_reset_password_from_key"),
    url(r'^password/reset/key/done/$',
        AllAuthPasswordResetFromKeyDoneView,
        name="account_reset_password_from_key_done"),

    # Login
Ejemplo n.º 17
0
    path('', views.index, name='index'),
    path('gu/ajax/validate-room-name',
         views.validate_room_name,
         name='validate_room_name'),
    path('<slug:name>', views.room, name='room'),
    path('gu/ajax/room/get/<int:pk>', views.room_ajax, name='room_ajax'),
    path('gu/ajax/room/get/<int:room_id>/message/<int:message_id>',
         views.clap_ajax,
         name='clap_ajax'),

    # name field is used in allauth
    path('gu/login',
         LoginView.as_view(template_name='gugugu/login.html'),
         name='account_login'),
    path('gu/signup',
         SignupView.as_view(template_name='gugugu/signup.html'),
         name='account_signup'),
    path('gu/logout', LogoutView.as_view(), name='account_logout'),

    # admin
    path('gu/sg-admin', views.admin, name='admin'),
    path('gu/sg-admin/stats', views.admin_stats, name='admin_stats'),
    path('gu/sg-admin/questions-claps',
         views.admin_questions_claps,
         name='admin_claps'),
    path('gu/sg-admin/questions-time',
         views.admin_questions_time,
         name='admin_time'),
    path('gu/sg-admin/popular', views.admin_popular, name='admin_popular'),
    path('gu/sg-admin/clapper', views.admin_clapper, name='admin_clapper'),
    path('gu/sg-admin/typer', views.admin_typer, name='admin_typer'),