Example #1
1
def get_patterns(user_model):
    # Registration urls
    return [
        path(
            settings.LOGIN_URL.lstrip('/'),
            LoginView.as_view(**dict(
                template_name='users/login.html',
                authentication_form=AuthenticationForm,
                extra_context=dict(
                    password_reset_url=reverse_lazy('users-password_reset'),
                    login_url=settings.LOGIN_URL,
                    next=settings.LOGIN_REDIRECT_URL,
                    login_view=True
                )
            )),
            name='users-login'
        ),
        path(
            'users/logout/',
            LogoutView.as_view(**dict(
                template_name='users/logged_out.html',
                next_page=settings.LOGOUT_REDIRECT_URL
            )),
            name='users-logout'
        ),
        # account confirmation url, protected by secret token; displayed when the users clicked the account confirm url
        # in its account confirmation email
        re_path(
            r'^users/account_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
            account_confirm, dict(
                template_name='users/account_confirm.html',
                set_password_form=AccountActivationPasswordForm,
                post_reset_redirect='/users/account_confirm_complete/',
                user_model=user_model
            ),
            name='users-account_confirm'
        ),
        # indicated that the account was successfully confirmed
        path(
            'users/account_confirm_complete/',
            TemplateView.as_view(
                template_name='users/account_confirm_complete.html',
                extra_context=dict(
                    login_redirect_url=settings.LOGIN_REDIRECT_URL,
                    login_url=settings.LOGIN_URL,
                    user_model=user_model
                )
            ),
            name='users-account_confirm_complete'
        ),

        # displays a form that takes a user's email address; when submitted, an email with a password reset url is sent
        # to that user
        path(
            'users/password_reset/',
            PasswordResetView.as_view(**dict(
                template_name='users/password_reset.html',
                success_url=reverse_lazy('users-password-reset-done'),
                email_template_name='users/email/password_reset.html',
                form_class=get_password_reset_form('users-password_reset_confirm', user_model),
            )),
            name='users-password_reset'
        ),
        # displays that the password change email has been sent.
        path(
            'users/password_reset_done/',
            PasswordResetDoneView.as_view(**dict(
                template_name='users/password_reset_done.html',
                extra_context=dict(login_url=settings.LOGIN_URL),
            )),
            name='users-password-reset-done'
        ),
        # displays the form where the user can choose its new password
        re_path(
            r'^users/password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
            PasswordResetConfirmView.as_view(**dict(
                template_name='users/password_reset_confirm.html',
                success_url=reverse_lazy('user-password_reset_complete'),
            )),
            name='users-password_reset_confirm'
        ),
        # indicates that the user's password has been successfully changed.
        path(
            'users/password_reset_complete/',
            PasswordResetCompleteView.as_view(**dict(
                template_name='users/password_reset_complete.html',
                extra_context=dict(login_url=settings.LOGIN_URL)
            )),
            name='user-password_reset_complete'
        )
    ]
Example #2
0
def logout(request):
    """return the django.contrib.auth or the django-allauth logout view"""
    if settings.USE_ALL_AUTH:
        # noinspection PyPackageRequirements
        from allauth.account.views import logout

        return logout(request)
    return LogoutView.as_view()(request)
Example #3
0
 def logout(self, request, extra_context=None):
     if request.method == 'POST':
         messages.info(request, _('Thanks for using Weblate!'))
         request.current_app = self.name
         return LogoutView.as_view(next_page=reverse('admin:login'))(request)
     context = self.each_context(request)
     context['title'] = _('Logout')
     return render(request, 'admin/logout-confirm.html', context)
Example #4
0
def logout(request, next_page=None,
           template_name='registration/logged_out.html',
           redirect_field_name=REDIRECT_FIELD_NAME):
    was_wind_login = SESSION_KEY in request.session
    django_logout(request)
    statsd.incr('djangowind.logout')
    if was_wind_login and hasattr(settings, 'CAS_BASE'):
        return HttpResponseRedirect('%scas/logout' % settings.CAS_BASE)
    else:
        return LogoutView.as_view()(
            request, next_page, template_name, redirect_field_name)
Example #5
0
def logout(request, extra_context=None):
    """
    Log out the user.

    This should *not* assume the user is already logged in.
    """
    extra_context = extra_context or {}
    # Since the user isn't logged out at this point, the value of has_permission must be overridden.
    extra_context['has_permission'] = False
    defaults = view_defaults(
        extra_context=extra_context,
        next_page=reverse(
            'index', current_app=request.resolver_match.app_name))
    return LogoutView.as_view(**defaults)(request)
Example #6
0
    def logout(self, request, extra_context=None):
        """
        Logs out the user for the given HttpRequest.

        This should *not* assume the user is already logged in.
        """
        from django.contrib.auth.views import LogoutView
        defaults = {
            'extra_context': dict(
                self.each_context(request),
                # Since the user isn't logged out at this point, the value of
                # has_permission must be overridden.
                has_permission=False,
                **(extra_context or {})
            ),
        }
        if self.logout_template is not None:
            defaults['template_name'] = self.logout_template
        request.current_app = self.name
        return LogoutView.as_view(**defaults)(request)
Example #7
0
from django.conf.urls            import include, url
from django.http                 import HttpResponse
from django.views.generic        import TemplateView
from django.conf                 import settings
from django.conf.urls.static     import static

from django.contrib.auth.views   import LoginView, LogoutView

urlpatterns = [
	url(r'', include('manager.urls')),
	url(r'^login/$', LoginView.as_view(template_name='login.html'), name='login'),
	url(r'^logout/$', LogoutView.as_view(template_name='logout.html'), name='logout'),
	url(r'^robots.txt', lambda x: HttpResponse('User-Agent: *\nDisallow: /', content_type='text/plain'), name='robots_file'),
]

if settings.LOCAL_DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

handler403 = lambda r: url(r, TemplateView.as_view(template_name='403.html'))
handler404 = lambda r: url(r, TemplateView.as_view(template_name='404.html'))
handler500 = lambda r: url(r, TemplateView.as_view(template_name='500.html'))
Example #8
0
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import include, path
from django.views.generic import RedirectView
from ibms.views import SiteHomeView, HealthCheckView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login/', LoginView.as_view(template_name='login.html'),
         name='login'),
    path('logout/',
         LogoutView.as_view(template_name='logged_out.html'),
         name='logout'),
    path('confluence/',
         RedirectView.as_view(url=settings.HELP_URL),
         name='help_page'),
    path('healthcheck/', HealthCheckView.as_view(), name='health_check'),
    path('', include('ibms.urls')),
    path('', include('sfm.urls')),
    path('', SiteHomeView.as_view(), name='site_home'),
]
Example #9
0
from smartmin.users.views import Login

from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.views import LogoutView

from . import views

logout_url = getattr(settings, "LOGOUT_REDIRECT_URL", None)

urlpatterns = [
    url(r"^login/$", Login.as_view(), dict(template_name="smartmin/users/login.html"), name="users.user_login"),
    url(r"^logout/$", LogoutView.as_view(),
        dict(redirect_field_name="go", next_page=logout_url), name="users.user_logout"),
]

urlpatterns += views.UserCRUDL().as_urlpatterns()
Example #10
0
    StateChangeDelete, StateAddStateChange,

    root, player_game, player_choose, faculty_section_reset,
    allpaths, allquestions, allvariables, faculty_section_manage,
    faculty_end_turn, faculty_section_bygroup, faculty_section_byplayer,
    faculty_group_detail, faculty_player_detail, faculty_feedback_submit,
    faculty_player_detail_byturn,
)

media_root = os.path.join(os.path.dirname(__file__), "media")

urlpatterns = [
    url(r'^media/(?P<path>.*)$', django.views.static.serve,
        {'document_root': media_root}),
    url(r'^$', root),
    url(r'^logout/$', LogoutView.as_view(
        template_name='sim/logged_out.html')),

    # player pages
    url(r'^player/game/(?P<group_id>\d+)/$', player_game),
    url(r'^player/game/(?P<group_id>\d+)/(?P<turn_id>\d+)/$', player_game),

    # player ajax requests
    url(r'^player/choose/$', player_choose),

    # faculty ajax requests
    url(r'^faculty/reset/(?P<section_id>\d+)/$', faculty_section_reset),

    # faculty management pages
    url(r'^allpaths/$', allpaths),
    url(r'^allpaths/questions$', allquestions),
    url(r'^allpaths/variables$', allvariables),
Example #11
0
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import include, path
from django.views.generic import RedirectView
from ibms.views import SiteHomeView, HealthCheckView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login/', LoginView.as_view(template_name='login.html'), name='login'),
    path('logout/', LogoutView.as_view(template_name='logged_out.html'), name='logout'),
    path('confluence/', RedirectView.as_view(url=settings.HELP_URL), name='help_page'),
    path('healthcheck/', HealthCheckView.as_view(), name='health_check'),
    path('', include('ibms.urls')),
    path('', include('sfm.urls')),
    path('', SiteHomeView.as_view(), name='site_home'),
]
Example #12
0
File: urls.py Project: szagot/mooc
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView
from . import views

# Definindo namespace
app_name = 'accounts'

urlpatterns = [
    path('', views.dashboard, name='dashboard'),

    # Usando a view do próprio Django para Login de usuários (não tem a ver com o ADMIN)
    path('entrar/',
         LoginView.as_view(template_name='accounts/login.html'),
         name='login'),
    # Usando a view do próprio Django para Logout
    path('sair/', LogoutView.as_view(next_page='core:home'), name='logout'),
    path('cadastro/', views.register, name='register'),
    path('cadastro/esqueci', views.password_reset, name='reset'),
    path('cadastro/esqueci/<slug:key>',
         views.password_reset_confirm,
         name='reset_confirm'),
    path('editar/usuario', views.edit, name='edit'),
    path('editar/senha/', views.edit_password, name='edit-pass'),
]
from django.conf.urls import url
from django.contrib.auth.views import LoginView, LogoutView

from .views import RegisterView


urlpatterns = [
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^login/$', LoginView.as_view(template_name='account/login.html'), name="login"),
    url(r'^logout/$', LogoutView.as_view(template_name='account/login.html'), name="logout"),
]
Example #14
0
from django.contrib.auth.views import LogoutView
from django.urls import path

from accounts import views

urlpatterns = [
    path('send_login_email', views.send_login_email, name='send_login_email'),
    path('login', views.login, name='login'),
    path('logout', LogoutView.as_view(), {'next_page': '/'}, name='logout'),
]
Example #15
0
from django.urls import path
from . import views
from django.contrib.auth.views import LoginView, LogoutView



urlpatterns = [
    path('',LoginView.as_view(redirect_authenticated_user=True),name='login'),
    path('register',views.Register.as_view(),name='register'),
    path('projects',views.EmptyProject.as_view()),
    path('profile',views.Profile.as_view()),
    path('all',views.AllUsers.as_view()),
    path('logout',LogoutView.as_view()),
    path('<username>',views.ProfilePage.as_view()),
    path('<username>/settings',views.ProfileSettings.as_view()),
    path('projects/all',views.AllProjects.as_view()),
    path('projects/create_project',views.ProjectCreation.as_view()),
    path('projects/<slug>',views.Project.as_view()),
    path('projects/<slug>/settings',views.ProjectSettings.as_view()),
    path('projects/<slug>/settings/add_part',views.AddingParts.as_view()),
    path('projects/<slug>/settings/update',views.UpdateParts.as_view()),
    path('projects/<slug>/comment',views.AddingComment.as_view()),
    path('projects/<slug>/lyrics',views.Lyrics.as_view()),
    path('projects/<slug>/stk/add',views.AddSoundtrack.as_view())
]
from django.views.generic import RedirectView, TemplateView


urlpatterns = [
    path('',
        RedirectView.as_view(
         pattern_name = 'about_urlpattern',
         permanent = False
        )),

    path('login/',
         LoginView.as_view(template_name='sneakersinfo/login.html'),
         name='login_urlpattern'
         ),

    path('logout/',
         LogoutView.as_view(),
         name='logout_urlpattern'
         ),

    path('about/',
         TemplateView.as_view(
             template_name='sneakersinfo/about.html'),
             name = 'about_urlpattern'
         ),

    path('admin/', admin.site.urls),

    path('', include('sneakersinfo.urls'))
]
Example #17
0
from . import views
from django.contrib.auth.views import LoginView,LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from django.contrib.auth import views as auth_views


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

urlpatterns = [
    path('admin/', admin.site.urls),
    path('registro/', include('apps.Registro.urls')),
    path('usuario/', include('apps.Usuario.urls')),
    path('', views.inicio, name="inicio"),
    path('estacionamientos', views.estacionamientos, name="estacionamientos"),
    path('ingresar/', auth_views.LoginView.as_view(template_name='Usuario/ingresar.html'), name='ingresar'),
    path('logout/', LogoutView.as_view(template_name='Usuario/logout.html'), name='cerrarSesion'),
    
    path('recuperarcontrasena/', PasswordResetView.as_view(template_name = 'Usuario/recuperarcontrasena.html'), name='recuperarcontrasena'),
    
    path('password-reset/done/', PasswordResetDoneView.as_view(template_name='Usuario/password_reset_done.html'), name='password_reset_done'),
    
    path('password-reset-confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(template_name=  'Usuario/password_reset_confirm.html') 
            , name='password_reset_confirm' ),
    
    path('password-reset-complete/', PasswordResetCompleteView.as_view(template_name='Usuario/password_reset_complete.html'), name='password_reset_complete'),
    
    path('social-auth/', include('social_django.urls', namespace="social")),
    
    path('', include('pwa.urls')),
]
Example #18
0
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LogoutView
from django.views.decorators.csrf import csrf_exempt

from gymkhana.schema import PrivateGraphQLView, PublicGraphQLView
from gymkhana.views import FrontendUpdateView, VueView
from oauth.views import SessionView

admin.site.site_title = 'Gymkhana Administration'
admin.site.site_header = 'Gymkhana Administration'
admin.site.index_title = 'Control Panel'

urlpatterns = [
    url(r'^logout/$', LogoutView.as_view(next_page='login'), name='logout'),
    url(r'^session/$', SessionView.as_view(), name='session'),
    url(r'^photologue/', include('photologue.urls', namespace='photologue')),
    url(r'^admin/', admin.site.urls),
    url(r'^ckeditor/', include('ckeditor_uploader.urls')),
    url(r'^admin/frontend-upload/',
        user_passes_test(lambda u: u.is_superuser, login_url='admin:login')(
            FrontendUpdateView.as_view()),
        name='admin-frontend-upload'),
    path('', include('social_django.urls', namespace='social')),
]

urlpatterns += [
    path("graphql", csrf_exempt(PublicGraphQLView.as_view(graphiql=True))),
    path("pgraphql", csrf_exempt(PrivateGraphQLView.as_view(graphiql=True)))
]
Example #19
0
from django.urls import path
from django.contrib.auth.views import LogoutView

from users.views import Login

urlpatterns = [
    path("inloggen/", Login.as_view(), name="login"),
    path("uitloggen/", LogoutView.as_view(), name="logout"),
]
Example #20
0
from django.urls import path
from django.contrib.auth.views import LoginView,LogoutView
urlpatterns=[
     path('login/',LoginView.as_view(template_name="accounts/login.html"), name='login'),
     path('logout/',LogoutView.as_view(template_name="index.html"), name='logout'),
 ]
Example #21
0
    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 import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView, PasswordChangeView, PasswordChangeDoneView
from django.contrib.flatpages import views

urlpatterns = [
    url(r'^accounts/login/$', LoginView.as_view(), name='login'),
    url(r'^accounts/logout/$', LogoutView.as_view(), name='logout'),
    url(r'^accounts/password/change/$', PasswordChangeView.as_view(), name='password_change'),
    url(r'^accounts/password/change/done/$', PasswordChangeDoneView.as_view(), name='password_change_done'),

    url(r'^timealign/', include('annotations.urls', namespace='annotations')),
    url(r'^preselect/', include('selections.urls', namespace='selections')),
    url(r'^stats/', include('stats.urls', namespace='stats')),
    url(r'^news/', include('news.urls', namespace='news')),

    url(r'^admin/', include(admin.site.urls)),

    url(r'^$', views.flatpage, {'url': '/home/'}, name='home'),
    url(r'^project/$', views.flatpage, {'url': '/project/'}, name='project'),
    url(r'^project/nl-summary/$', views.flatpage, {'url': '/project/nl-summary/'}, name='nl-summary'),
    url(r'^project/collaborations/$', views.flatpage, {'url': '/project/collaborations/'}, name='collaborations'),
    url(r'^project/videos/$', views.flatpage, {'url': '/project/videos/'}, name='videos'),
Example #22
0
from django.urls import path
from .views import (
    TaskList,
    TaskDetail,
    TaskCreate,
    TaskUpdate,
    DeleteView,
    CustomLoginView,
    RegisterPage,
)

from django.contrib.auth.views import LogoutView

urlpatterns = [
    path('login/', CustomLoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(next_page='login'), name='logout'),
    path('register/', RegisterPage.as_view(), name='register'),
    path('', TaskList.as_view(), name='main'),
    path('task-detail/<int:pk>', TaskDetail.as_view(), name='task-detail'),
    path('task-create/', TaskCreate.as_view(), name='task-create'),
    path('task-update/<int:pk>', TaskUpdate.as_view(), name='task-update'),
    path('task-delete/<int:pk>', DeleteView.as_view(), name='task-delete'),
]
Example #23
0
from django.urls import path, include
from django.contrib.auth.views import LogoutView
from django.conf import settings
from . import api
from . import views

apipattens = [
    path('check_token/', api.CheckToken.as_view(), name='check_token'),
    path('change_email/', api.ChangeEmail.as_view(), name='change_email'),
    path('change_token/', api.ChangeToken.as_view(), name='change_token'),
    path('reset_token_email/', api.ResetTokenEmail.as_view(), name='reset_token_email'),
    path('list_profiles/', api.ListProfiles.as_view(), name='list_profiles'),
    path('list_hacker_profiles/', api.ListHackerProfiles.as_view(), name='list_hacker_profiles'),
    path('sui_list_profiles/', api.SUIListProfiles.as_view(), name='sui_list_profiles'),
]

app_name = 'profile'
urlpatterns = [
    path('api/', include((apipattens, 'api')), name='api'),
    path('logout/', LogoutView.as_view(next_page=settings.LOGIN_URL), name='logout'),
    path('token_login/<str:token>/', views.TokenLoginView.as_view(), name='token_login'),
    path('verify_email/<str:code>/', views.VerifyEmailView.as_view(), name='verify_email'),
]
Example #24
0
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/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
from django.urls.conf import include

from django.contrib.auth.views import LoginView, LogoutView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('blogging.urls')),
    path('polling/', include('polling.urls')),
    path('login/', LoginView.as_view(template_name='login.html'),
         name="login"),
    path('logout/', LogoutView.as_view(next_page='/'), name="logout")
]
Example #25
0
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.views import LogoutView
from django.urls import path
import django.contrib.auth.views
import notifications.urls

admin.autodiscover()

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    path('logout/',LogoutView.as_view(),name='logout'),
    path('', include('django.contrib.auth.urls')),
    url(r'', include('accounts.urls')),
]

if 'editor_rest_api' in settings.INSTALLED_APPS:
    try:
        from editor_rest_api.urls import urls as rest_urls
        urlpatterns += [
            url('^api/', include(rest_urls)),
        ]
    except ImportError:
        pass

urlpatterns += [
    url(r'', include('editor.urls')),
    url(r'^migrate/', include('migration.urls')),
Example #26
0
from django.urls import path
from . import views
from django.contrib.auth.views import LoginView, LogoutView
urlpatterns = [
    path('', views.indexView,name="home"),
    path('dashboard/', views.dashboardView, name="dashboard"),
    path('login/', LoginView.as_view(), name="login_url"),
    path('register/', views.registerView, name="register_url"),
    path('logout/', LogoutView.as_view(next_page='dashboard'), name="logout"),
    path('contact/', views.contact, name="ContactUs"),
    path('about/', views.about, name="about"),
]
Example #27
0
from django.urls import path
from apps.Main import views
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LoginView,LogoutView,PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView

urlpatterns=[
    path('', LoginView.as_view(template_name='social/login.html'), name='login'),
    path('feed', views.feed, name='feed'),
    path('profile/', views.profile, name='profile'),
    path('profile/<str:username>/',views.profile, name='profile'),
    path('register/', views.register, name='register'),
    path('password_reset/', PasswordResetView.as_view(template_name='social/recuperar.html', email_template_name='social/password_reset_email.html'), name='password_reset'),
    path('password_reset_done/', PasswordResetDoneView.as_view(template_name='social/password_reset_done.html'), name='password_reset_done'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', PasswordResetConfirmView.as_view(template_name='social/password_reset_confirm.html'), name='password_reset_confirm'),
    path('done/', PasswordResetCompleteView.as_view(template_name='social/password_reset_complete.html'), name='password_reset_complete'),
    path('logout/', LogoutView.as_view(template_name='social/logout.html'), name='logout'),
    path('follow/<str:username>/', views.follow, name='follow'),
    path('unfollow/<str:username>/', views.unfollow, name='unfollow'),
    path('trends/',views.trends, name='trends'),
    url(r'^edit/(?P<user_id>\d+)/$',views.editarPerfil, name='edit'),
    path('notificaciones/', views.notificaciones, name='notificaciones'),

]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #28
0
"""BlogCloneProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 LoginView,LogoutView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('',include('blog.urls')),
    path('accounts/login/',LoginView.as_view(),name='login'),
    path('accounts/logout/',LogoutView.as_view(),name='logout',kwargs={'next_page':'/'}),
]
Example #29
0
from django.conf.urls import include, url
from django.contrib.auth.views import LoginView, LogoutView

from django.contrib import admin
admin.autodiscover()

admin.site.site_header = "WLNet DataView Administrator"
admin.site.site_title = "WLNet DataView"

from portal.views import index
from dataview.views import v1_config

urlpatterns = [
    url(r'^$', index, name='index'),
    url(r'^api/1/config$', v1_config, name='v1_config'),
    url(r'^api/', include('api.urls')),

    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', admin.site.urls),
    
    url(r'^account/login/$', LoginView.as_view(template_name='registration/login.html')),
    url(r'^account/logout/$', LogoutView.as_view()),

    url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),

]
Example #30
0
from django.urls import path, re_path
from django.contrib.auth.views import LogoutView

from .views import (
    # login_page,
    # register_page,
    account_home_view,
    # View based Class
    LoginView,
    AccountHomeView,
    AccountEmailActivateView,
    UserDetailUpdateView,
    register,
)

app_name = "accounts"

urlpatterns = [
    path("login/", LoginView.as_view(), name="login"),
    path("register/", register, name="register"),
    path("logout/", LogoutView.as_view(), name="logout"),
    path("", account_home_view, name="home"),
    re_path(r'^email/confirme/(?P<key>[0-9A-Za-z]+)/$',
            AccountEmailActivateView.as_view(),
            name="email_activate"),
    path("email/resend-activation",
         AccountEmailActivateView.as_view(),
         name="resend_activation"),
    path("update", UserDetailUpdateView.as_view(), name="user_update"),
]
Example #31
0
from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from django.conf.urls import url
from django.urls import path
from . import views

urlpatterns = [
    url(r'^$', views.dashboard, name='dashboard'),
    url(r'^login/$', LoginView.as_view(template_name='account/registration/login.html'), name='login'),
    url(r'^logout/$', LogoutView.as_view(template_name='account/registration/logout.html'), name='logout'),
    path('register/<uuid:tokenFromURL>', views.register, name='register'),
    url(r'^doRegistration/$', views.doRegistration, name='doRegistration'),
    url(r'^generateToken/', views.generateToken, name='token_generation'),
    url(r'^doTokenGeneration/', views.doTokenGeneration, name='doTokenGeneration'),
    url(r'^edit_profile/', views.edit_profile, name="edit_profile"),
    url(r'^changePassword/$', views.change_password, name='change_password'),
	url(r'^password_reset/$', PasswordResetView.as_view(template_name='account/password_reset_form.html', email_template_name='account/password_reset_email.html', subject_template_name='account/password_reset_subject.txt'), name='passwordReset'),
    url(r'^password_reset/done/$', PasswordResetDoneView.as_view(template_name='account/password_reset_done.html'), 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})/$',PasswordResetConfirmView.as_view(template_name='account/password_reset_confirm.html'), name='password_reset_confirm'),
    url(r'^reset/done/$', PasswordResetCompleteView.as_view(template_name='account/password_reset_complete.html'), name='password_reset_complete'),
    #url(r'^logout-then-login/$', logout_then_login, name='logout_then_login'),
]
Example #32
0
from django.urls import path
from . import views
from django.contrib.auth.views import LoginView, LogoutView

urlpatterns = [
    path("", views.indexView, name="home"),
    #path("dashboard/",views.dashboardView,name="dashboard"),
    path("login/", LoginView.as_view(), name="login_url"),
    path("register/", views.registerView, name="register_url"),
    path("logout/", LogoutView.as_view(next_page="home"), name="logout"),
]
Example #33
0
from django.shortcuts import render
from django.urls import path
from robots.views import rules_list
from sitegate.toolbox import get_sitegate_urls
from sitemessage.toolbox import get_sitemessage_urls

from apps.realms import bootstrap_realms  # Здесь относительный импорт работать не будет.
from apps.views import page_not_found, permission_denied, server_error, index, search, login, telebot, user_settings

urlpatterns = [
    path('', index, name='index'),
    path('search/site/', render, {'template_name': 'static/search_site.html'}, name='search_site'),
    path('search/', search, name='search'),
    path('login/', login, name='login'),
    path('settings/', user_settings, name='settings'),
    path('logout/', LogoutView.as_view(), {'next_page': '/'}, name='logout'),
    path('promo/', render, {'template_name': 'static/promo.html'}),
    path('about/', render, {'template_name': 'static/about.html'}),
    path('sitemap/', render, {'template_name': 'static/sitemap.html'}),
    path('robots.txt', rules_list, name='robots_rule_list'),
    path('%s/' % settings.TELEGRAM_BOT_URL, telebot),
    path('%s/' % settings.ADMIN_URL, admin.site.urls),
]

urlpatterns += get_sitegate_urls()  # Цепляем URLы от sitegate,
urlpatterns += get_sitemessage_urls()  # Цепляем URLы от sitemessage,

# Используем собственные страницы ошибок.
handler403 = permission_denied
handler404 = page_not_found
handler500 = server_error
Example #34
0
from django.views.generic import TemplateView
from django.contrib.auth.views import LoginView, LogoutView

# Import from my app
from . import views

urlpatterns = [
    path('', TemplateView.as_view(template_name='food/home.html'),
         name='home'),
    path('index/',
         TemplateView.as_view(template_name='food/home.html'),
         name='home'),
    path('home/',
         TemplateView.as_view(template_name='food/home.html'),
         name='home'),
    path('account/', views.account, name='account'),
    path('account/register/', views.register, name='register'),
    path('account/signin/',
         LoginView.as_view(template_name='food/signin.html'),
         name='signin'),
    path('account/signout/',
         LogoutView.as_view(template_name='food/home.html'),
         name='signout'),
    path('foodresult/', views.foodresult, name='foodresult'),
    path('foodinfo/<int:pk>/', views.FoodInfo.as_view(), name='foodinfo'),
    path('selection/', views.selection, name='selection'),
    path('imprint/',
         TemplateView.as_view(template_name='food/imprint.html'),
         name='imprint'),
]
Example #35
0
from django.urls import path

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static  

from django.contrib.auth.views import (LoginView, LogoutView)

from Projects.views import (home,request_pr,response_pr,leaderboard, profile)
from Users.views import (signin,register)

urlpatterns = [
    path('admin', admin.site.urls),
    path('', home, name='home'),
    path('signin', signin , name='signin'), 
    path('register', register , name='register'), 
    path('logout', LogoutView.as_view(), {'next_page': 'signin'}, name='logout'),

    # path('api/github_webhook/', views.github_webhook, name='github_webhook')
    path('request_pr', request_pr , name='request_pr'),
    path('response_pr', response_pr , name='response_pr'),

    path('leaderboard', leaderboard , name='leaderboard'),     
    path('<username>', profile, name='profile'),
]
# (?P<username>[^/]+)/

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
   
Example #36
0
from django.urls import path, include
from django.contrib.auth.views import LoginView, LogoutView

from .views import *

urlpatterns = [
    path('login',
         LoginView.as_view(template_name='app/login_form.html'),
         name='user_login'),
    path('logout', LogoutView.as_view(), name='user_logout'),
    path('signup', SignUpView.as_view(), name='user_signup'),
    path('about', about, name='app_about'),
]
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView
from django.views.generic import TemplateView

urlpatterns = [
    path(r"", TemplateView.as_view(template_name="home.html"), name="home"),
    path(r"login/", LoginView.as_view(), name="auth_login"),
    path(r"logout/", LogoutView.as_view(template_name="logout.html"), name="auth_logout"),
]
Example #38
0
from django.urls import path
from . import views
from django.contrib.auth.views import LoginView, LogoutView
from django.contrib.auth import views as auth_views

app_name = 'accounts'

urlpatterns = [
    path('register/', views.register_view, name="register_view"),
    path('login/', LoginView.as_view(), name="login_url"),
    path('logout_view/', LogoutView.as_view(), name="logout_view"),
    path('reset_password/', auth_views.PasswordResetView.as_view()),
    path('profile/', views.view_profile, name='view_profile'),
    path('profile/edit/', views.edit_profile, name='edit_profile'),
    path('change-password/', views.change_password, name='change_password'),
    path('edit_all/', views.edit_all, name='custmize'),
    path('delete_profile/', views.delete_profile, name='delete_profile'),
    path('activer_profile/', views.activer_profile, name='activer_profile'),
    path('contact/', views.contact, name='contact'),
]
Example #39
0
from django.conf.urls import url
from django.contrib.auth.views import \
    PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, \
    PasswordResetCompleteView, LoginView, LogoutView

from comandes import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^fer_comanda', views.fer_comanda, name='fer_comanda'),
    url(r'^esborra_comanda', views.esborra_comanda, name='esborra_comanda'),
    url(r'^comandes', views.veure_comandes, name='comandes'),
    url(r'^informe_proveidors', views.informe_proveidors, name='informe_proveidors'),
    url(r'^informe_caixes', views.informe_caixes, name='informe_caixes'),
    url(r'^test_email', views.test_email, name="test_email"),
    url(r'^recuperar_contrasenya/$', PasswordResetView.as_view(), name="recuperar_contrasenya"),
    url(r'^password_reset/$', PasswordResetView.as_view(), name="password_reset"),
    url(r'^password_reset_done/$', PasswordResetDoneView.as_view(), name="password_reset_done"),
    url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', PasswordResetConfirmView.as_view(), name="password_reset_confirm"),
    url(r'^password_reset_complete/$', PasswordResetCompleteView.as_view(), name="password_reset_complete"),
    url(r'^afegeix_proveidors/', views.afegeix_proveidors, name="afegeix_proveidors" ),
    url(r'^distribueix_productes/(?P<data_recollida>[0-9-]+)/(?P<producte>\w{0,50})/$', views.distribueix_productes, name="distribueix_productes" ),
    url(r'^accounts/login/$', LoginView.as_view(template_name='login.html'), name='login'),
    url(r'^accounts/logout/$', LogoutView.as_view(next_page='/')),
    #{'next_page': '/'}),
]

#http://stackoverflow.com/questions/21284672/django-password-reset-password-reset-confirm
# change SITE_ID in settings.py
Example #40
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 LoginView, LogoutView 
from core import views


urlpatterns = [
    path('', views.index, name='index'),
    path('contato/', views.contact, name='contact'),
    path('entrar/', LoginView.as_view(template_name='login.html'), name='login'),
    path('sair/', LogoutView.as_view(next_page='index'), name='logout'),
    path('catalogo/', include('catalog.urls')),
    path('conta/', include('accounts.urls')),
    path('compras/', include('checkout.urls')),
    path('admin/', admin.site.urls),
]
Example #41
0
    ),
    path(
        "dashboard/requests/employees/<int:request_pk>/reject/",
        views.RejectEmployeeRequest.as_view(),
        name="reject-employee-request",
    ),
    path(
        "dashboard/requests/employees/<int:request_pk>/",
        views.DetailEmployeeRequest.as_view(),
        name="detail-employee-request",
    ),
    path(
        "dashboard/requests/contractors/<int:request_pk>/approve/",
        views.ApproveContractorRequest.as_view(),
        name="approve-contractor-request",
    ),
    path(
        "dashboard/requests/contractors/<int:request_pk>/reject/",
        views.RejectContractorRequest.as_view(),
        name="reject-contractor-request",
    ),
    path(
        "dashboard/requests/contractors/<int:request_pk>/",
        views.DetailContractorRequest.as_view(),
        name="detail-contractor-request",
    ),
    path("admin/", admin.site.urls),
    path("login", LoginView.as_view(), name="login"),
    path("logout", LogoutView.as_view(), name="logout"),
]
Example #42
0
from django.urls import path, include
from django.contrib.auth.views import LoginView, LogoutView
from . import views

urlpatterns = [
    path('register/', views.register, name='register'),
    path(r'login/',
         LoginView.as_view(template_name='registration/login.html'),
         name='login'),
    path(r'logout/',
         LogoutView.as_view(next_page='registration/login.html'),
         name='logout'),
    path('accounts/profile/', views.indexs, name='indexs'),
    path('loginNow/', views.LoginNow, name='LoginNow'),
    path('logout/registration/login.html', views.indexs, name='indexs')
]
Example #43
0
# -*- coding: utf-8 -*-

from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib.auth.views import LoginView, LogoutView
from django.views.generic import TemplateView

from slavdict.dictionary.admin import ui
admin.autodiscover()

urlpatterns = [
    url( r'^',           include('slavdict.dictionary.urls') ),
    url( r'^admin/',     include(admin.site.urls) ),
    url( r'^admin/doc/', include('django.contrib.admindocs.urls') ),
    url( r'^ui/',        include(ui.urls) ),
    url( r'^login/$',    LoginView.as_view() ),
    url( r'^logout/$',   LogoutView.as_view(next_page='/'), name='logout' ),
    url( r'^test/$',     TemplateView.as_view(template_name='test.html') ),
]

urlpatterns += staticfiles_urlpatterns()
Example #44
0
from django.contrib import admin
from django.contrib.auth.views import LogoutView, PasswordChangeView
from django.urls import path, re_path, reverse_lazy
from django.conf.urls.static import static
from django.conf import settings
from mediaportal_app.views import (CategoryListView, CategoryDetailView, ArticleDetailView, CreateCommentView, 
	DisplayArticlesByCategory, UserReactionView, RegisterUserView, LoginUserView, UserAccountView, AddArticlesToFavoutitesView,
	SearchView)


urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^$', CategoryListView.as_view(), name='categories_view'),
    re_path(r'^category/(?P<slug>[-\w]+)/$', CategoryDetailView.as_view(), name='category_detail_view'),
    re_path(r'^search/$', SearchView.as_view(), name='search_view'),
    re_path(r'^article/(?P<category_slug>[-\w]+)/(?P<slug>[-\w]+)/$', ArticleDetailView.as_view(), name='article_detail_view'),
    re_path(r'^add_comment/$', CreateCommentView.as_view(), name='create_comment_view'),
    re_path(r'^add_article_to_favourites/$', AddArticlesToFavoutitesView.as_view(), name='add_article_to_favourites_view'),
    re_path(r'^send_like_dislike/$', UserReactionView.as_view(), name='user_reaction_view'),
    re_path(r'^display_articles_by_category/$', DisplayArticlesByCategory.as_view(), name='display_articles_by_category_view'),
    re_path(r'^sign_up/$', RegisterUserView.as_view(), name='registration_view'),
    re_path(r'^sign_in/$', LoginUserView.as_view(), name='login_view'),
    re_path(r'^logout/$', LogoutView.as_view(next_page=reverse_lazy('categories_view')), name='logout_view'),
    re_path(r'^change_password/$', PasswordChangeView.as_view(success_url=reverse_lazy('categories_view')), name='change_password_view'),
    re_path(r'^user/(?P<user>[-\w]+)/$', UserAccountView.as_view(), name='account_view'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #45
0
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib.auth.views import LoginView, LogoutView

from website import views

urlpatterns = [
    url(r'^$', views.index, name="index"),
    url(r'^create$', views.create_gallery, name="create"),
    url(r'^upload$', views.upload, name="upload"),
    url(r'^gl/(?P<gid>[-A-Za-z0-9_]+)$', views.gallery, name="gallery"),
    url(r'^rm/gl/(?P<gid>[-A-Za-z0-9_]+)$', views.remove_gallery, name="remove_gl"),
    url(r'^rm/img/(?P<mid>[-A-Za-z0-9_]+)$', views.remove_img, name="remove_img"),
    url(r'^crop/img/(?P<mid>[-A-Za-z0-9_]+)$', views.crop, name="crop"),
    url(r'^cover/(?P<gid>[-A-Za-z0-9_]+)$', views.cover_gallery, name="cover"),
    url(r'^name/(?P<gid>[-A-Za-z0-9_]+)$', views.name_gallery, name="name"),
    url(r'^cover/set/(?P<gid>[-A-Za-z0-9_]+)/(?P<mid>[-A-Za-z0-9_]+)$', views.set_cover_gallery, name="set_cover"),
    url(r'^name/set/(?P<gid>[-A-Za-z0-9_]+)$', views.set_name_gallery, name="set_name"),

    url(r'^register$',  views.register, name="register"),
    url(r'^login$',  LoginView.as_view(), name="login"),
    url(r'^logout$', LogoutView.as_view(), name="logout"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Example #46
0
from django.contrib.auth.views import LogoutView
from django.urls import path, include

from . import views

app_name = 'accounts'
urlpatterns = [
    # CRUD for quizzes

    # Profile user
    path('account/profile/', views.profileView, name='profile'),
    path('profile/update/<int:pk>/',
         views.profile_change,
         name='profile_update'),

    # Register/auth users
    path('login/', views.login_page, name='login'),
    path('social-auth/', include('social_django.urls', namespace='social')),
    path('register/', views.registerView, name='register'),
    path('logout/',
         LogoutView.as_view(next_page='accounts:login'),
         name='logout'),

    # main page
    path('', views.index, name='index'),
]
Example #47
0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import base64
import logging

from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required
try:
    from django.contrib.auth.views import LogoutView
    django_logout = LogoutView.as_view()
except ImportError:
    from django.contrib.auth.views import logout as django_logout
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.http import Http404, HttpResponse
from django.http import HttpResponseRedirect  # 30x
from django.http import HttpResponseBadRequest  # 40x
from django.http import HttpResponseServerError  # 50x
from django.views.decorators.http import require_POST
from django.shortcuts import render
from django.template import TemplateDoesNotExist
from django.utils.six import text_type, binary_type, PY3
from django.views.decorators.csrf import csrf_exempt

from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST
from saml2.metadata import entity_descriptor
Example #48
0
from django.urls import include, path

from agentex.admin import calibrator_check, allcalibrators_check
from agentex.views import index, AddValuesView, \
    read_manual_check, updatedataset, graphview_simple, \
    classifyupdate, graphview_ave, FinalLightCurve, \
    EventView, EventList, DataEntry, next_datasource
from agentex.users import register, editaccount, profile, briefing, feedback

admin.autodiscover()

urlpatterns = [
    path('',index, name='index'),
    path('admin/', admin.site.urls),
    path('account/login/', LoginView.as_view(template_name= 'agentex/login.html'), name='login'),
    path('account/logout/', LogoutView.as_view(template_name='agentex/logout.html'), name='logout'),

    path('admin/calibrators/<int:planetid>/id/<int:calid>/',calibrator_check, name='agentex_admin_calib'),
    path('admin/calibrators/<int:planetid>/',allcalibrators_check, name='agentex_all_calib'),
    path('account/register/', register, name='register'),
    path('account/', editaccount, name='editaccount'),
    path('profile/',profile, name='profile'),
    path('planets/',EventList.as_view(), name='target'),
    path('fitsanalyse/',AddValuesView.as_view(), name='fitsanalyse'),
    #path('test',tester, name='tester'),
    path('briefing/read/',read_manual_check, name='read_manual_check'),
    path('briefing/',briefing, name='briefing'),
    path('comment/',feedback, name='addcomment'),
    path('source/<int:pk>/view/',DataEntry.as_view(), name='addvalue'),
    path('target/<slug:slug>/next/', next_datasource, name='next_addvalue'),
    path('target/<slug:slug>/graph/update/',updatedataset, name='updatedataset'),
Example #49
0
from django.views.generic.base import TemplateView
from django.conf.urls import url, include
from django_registration.views import RegistrationView
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import reverse_lazy
from sweettooth.auth import views, forms

urlpatterns = [
    url(r'^login/', LoginView.as_view(form_class=forms.AuthenticationForm), name='auth-login'),

    url(r'^change_display_name/(?P<pk>\d+)', views.ajax_change_display_name),

    url(r'^logout/', LogoutView.as_view(next_page='/'), name='auth-logout'),

    url(r'^register/$', RegistrationView.as_view(form_class=forms.AutoFocusRegistrationForm),
        name='registration_register'),

    url(r'settings/(?P<user>.+)', TemplateView.as_view(template_name='profile/settings.html'),
        name='auth-settings'),

    url(r'', include('django_registration.backends.activation.urls')),
    url(r'^profile/(?P<user>.+)', views.profile, name='auth-profile'),
    url(r'^profile/', views.profile_redirect, name='auth-profile'),

    url(r'^login/$',
        auth_views.LoginView.as_view(),
        name='auth-login'),
    url(r'^logout/$',
        auth_views.LogoutView.as_view(),
Example #50
0
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.contrib.auth.views import LoginView, LogoutView, \
    PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = (
    # login and logout url
    url(r'^login/$', LoginView.as_view(template_name='login.html'), name='login'),
    # or use logout with template 'logout.html'
    url(r'^logout/$', LogoutView.as_view(), name='logout'),

    # password reset urls
    url(r'^password_reset/$',
        PasswordResetView.as_view(template_name='password_reset.html'),
        name='password_reset'),
    url(r'^password_reset_done/$',
        PasswordResetDoneView.as_view(template_name='password_reset_done.html'),
        name='password_reset_done'),
    url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),
        name='password_reset_confirm'),
    url(r'^password_reset_complete/$',
        PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),
        name='password_reset_complete'),
)
Example #51
0
from __future__ import unicode_literals, print_function, absolute_import
from django.conf import settings
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path, reverse
from django.views.generic import RedirectView
from .views import local_admin_login

app_name = "kirppuauth"

_urls = []


if not settings.KIRPPU_USE_SSO:
    _urls.append(path('login/', LoginView.as_view(
        template_name="kirppuauth/login.html",
        extra_context={
            "ask_pass": True,
            "submit": lambda: reverse('kirppuauth:local_login'),
        },
    ), name='local_login'))

_urls.append(path('profile/', RedirectView.as_view(pattern_name="home", permanent=False)))
_urls.append(path('logout/', LogoutView.as_view(next_page="home"), name='local_logout'))

if settings.KIRPPU_SU_AS_USER:
    _urls.append(path('set_user', local_admin_login, name='local_admin_login'))


urlpatterns = _urls
Example #52
0
from django.urls import path, re_path
from . import views
from django.contrib.auth.views import LoginView, LogoutView

urlpatterns = [
    path('home/', views.home, name='home'),
    path('admin_login/', views.adminlogin, name='admin_login'),
    path('about_us/', views.aboutus, name='about_us'),
    path('eligibility/', views.eligibility, name='eligibility'),
    path('donor/', views.donor, name='donor'),
    path('sign_in/', views.signin, name='sign_in'),
    path('t_c/', views.tandc, name='t_c'),
    re_path(r'^login/$',
            LoginView.as_view(template_name='login.html',
                              redirect_field_name='next'),
            name='login'),
    re_path(r'^logout/$', LogoutView.as_view(next_page="home"), name='logout'),
    path('profile/', views.profile, name='profile'),
    path('profile/favourite/', views.favourite, name='favourite'),
    path('seek/', views.requests, name='seek'),
    re_path(r'^update/$', views.update, name="update"),
    re_path(r'^delete/$', views.delete, name="delete"),
    path('profile/edit', views.profile_edit, name='profile_edit'),
    path('password/', views.change_password, name='change_password'),
    re_path(r'^contact/$', views.contact_us, name='contact'),
    re_path(r'^profile/(?P<pk>[0-9]+)$', views.detail, name='detail'),
    re_path(r'^donor/(?P<pk>[0-9]+)$', views.detail, name='detail'),
]
Example #53
0
from django.views.static import serve


admin.autodiscover()

urlpatterns = [
    url(r'^', include('website.urls', namespace='website')),
    url(r'sso/', include('pyTUID.urls')),
    url(r'^mitmachen/', include('staff.urls', namespace='staff')),
    url(r'^teilnehmer/', include('students.urls', namespace='students')),
    url(r'^klausur/', include('exam.urls', namespace='exam')),
    url(r'^workshops/', include('workshops.urls', namespace='workshops')),
    url(r'^dashboard/', include('dashboard.urls', namespace='dashboard')),
    url(r'^clothing/', include('clothing.urls', namespace='clothing')),
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/login/$', LoginView.as_view(template_name = 'admin/login.html'), name='login'),
    url(r'^accounts/logout/$', LogoutView.as_view(next_page=reverse_lazy('website:homepage')), name='logout'),
    url(r'^i18n/', include('django.conf.urls.i18n')),
]

if settings.DEBUG:
    urlpatterns += [
        url(r'^media/(?P<path>.*)$', serve, {
            'document_root': settings.MEDIA_ROOT,
        }),
    ]

    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]
Example #54
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path
from . import views

urlpatterns = [
    path('register', views.register, name='register'),
    path('login',
         LoginView.as_view(template_name='user/login.html'),
         name="login"),
    path('logout', LogoutView.as_view(next_page="/"), name="logout"),
    path('profile', views.profile, name='profile')
]
Example #55
0
 url(r'^analytics/sales/$', SalesView.as_view(), name='sales-analytics'),
 url(r'^analytics/sales/data/$',
     SalesAjaxView.as_view(),
     name='sales-analytics-data'),
 url(r'^contact/$', contact_page, name='contact'),
 url(r'^login/$', LoginView.as_view(), name='login'),
 url(r'^checkout/address/create/$',
     checkout_address_create_view,
     name='checkout_address_create'),
 url(r'^checkout/address/reuse/$',
     checkout_address_reuse_view,
     name='checkout_address_reuse'),
 url(r'^register/guest/$',
     GuestRegisterView.as_view(),
     name='guest_register'),
 url(r'^logout/$', LogoutView.as_view(), name='logout'),
 url(r'^api/cart/$', cart_detail_api_view, name='api-cart'),
 url(r'^cart/', include('carts.urls', namespace='cart')),
 url(r'^billing/payment-method/$',
     payment_method_view,
     name='billing-payment-method'),
 url(r'^billing/payment-method/create/$',
     payment_method_create_view,
     name='billing-payment-method-endpoint'),
 url(r'^register/$', RegisterView.as_view(), name='register'),
 url(r'^library/$', LibraryView.as_view(), name='library'),
 url(r'^orders/', include('orders.urls', namespace='orders')),
 url(r'^products/', include('products.urls', namespace='products')),
 url(r'^search/', include('search.urls', namespace='search')),
 url(r'^settings/$', RedirectView.as_view(url='/account')),
 url(r'^settings/email/$',
Example #56
0
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LogoutView

from . import views

app_name = 'accounts'

urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'sign_in/$', views.SignInView.as_view(), name='sign_in'),
    url(r'sign_up/$', views.RegisterView.as_view(), name='sign_up'),
    url(r'sign_out/$',
        LogoutView.as_view(), {'next_page': settings.LOGOUT_REDIRECT_URL},
        name='sign_out'),
    url(r'profile/$', views.ProfileView.as_view(), name='profile'),
    url(r'profile/edit/$',
        views.ProfileUpdateView.as_view(),
        name='edit_profile'),
    url(r'project/new/$',
        views.ProjectCreateView.as_view(),
        name='project_new'),
    url(r'project/(?P<pk>\d+)/edit/$',
        views.ProjectUpdateView.as_view(),
        name='project_edit'),
    url(r'project/(?P<pk>\d+)/$', views.ProjectView.as_view(), name='project'),
    url(r'project/(?P<pk>\d+)/delete/$',
        views.ProjectDeleteView.as_view(),
        name='project_delete'),
    url(r'applications/(?P<pk>\d+)/$',
Example #57
0
from django.conf.urls import include, url
from django.contrib.auth.views import LogoutView

from two_factor.gateways.twilio.urls import urlpatterns as tf_twilio_urls
from two_factor.urls import urlpatterns as tf_urls
from two_factor.views import LoginView

from .views import SecureView

urlpatterns = [
    url(
        regex=r'^account/logout/$',
        view=LogoutView.as_view(),
        name='logout',
    ),
    url(
        regex=r'^account/custom-login/$',
        view=LoginView.as_view(redirect_field_name='next_page'),
        name='custom-login',
    ),

    url(
        regex=r'^secure/$',
        view=SecureView.as_view(),
    ),
    url(
        regex=r'^secure/raises/$',
        view=SecureView.as_view(raise_anonymous=True, raise_unverified=True),
    ),
    url(
        regex=r'^secure/redirect_unverified/$',
Example #58
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from users.views import UserCreateView, UserDetailView

app_name = 'users'

urlpatterns = [
    path('create/', UserCreateView.as_view(), name='create'),
    path('detail/<int:pk>', UserDetailView.as_view(), name='detail'),
    path('login/', LoginView.as_view(template_name='form.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
]
Example #59
0
"""ghini URL Configuration

"""
from django.contrib import admin
from django.urls import path, include
from django.views.generic.base import RedirectView
from django.contrib.auth.views import LoginView, LogoutView

favicon_view = RedirectView.as_view(url='/static/favicon.ico', permanent=True)
root_view = RedirectView.as_view(url='/browse/', permanent=True)

urlpatterns = [
    # admin
    path('admin/', admin.site.urls),
    path('accounts/login/', LoginView.as_view(), name='login'),
    path('accounts/logout/', LogoutView.as_view(next_page='/'), name='logout'),
    # include
    path('taxonomy/', include('taxonomy.urls')),
    path('collection/', include('collection.urls')),
    path('garden/', include('garden.urls')),
    path('browse/', include('browse.urls')),
    path('select2/', include('django_select2.urls')),
    # root redirect views
    path("favicon.ico", favicon_view, name='favicon'),
    path('', root_view, name='home'),
]
Example #60
0
from saml2.validate import ResponseLifetimeExceed, ToEarly
from saml2.xmldsig import (  # support for SHA1 is required by spec
    SIG_RSA_SHA1, SIG_RSA_SHA256)

from .cache import IdentityCache, OutstandingQueriesCache, StateCache
from .conf import get_config
from .exceptions import IdPConfigurationMissing
from .overrides import Saml2Client
from .signals import post_authenticated
from .utils import (available_idps, fail_acs_response, get_custom_setting,
                    get_idp_sso_supported_bindings, get_location,
                    validate_referral_url)

try:
    from django.contrib.auth.views import LogoutView
    django_logout = LogoutView.as_view()
except ImportError:
    from django.contrib.auth.views import logout as django_logout

logger = logging.getLogger('djangosaml2')


def _set_subject_id(session, subject_id):
    session['_saml2_subject_id'] = code(subject_id)


def _get_subject_id(session):
    try:
        return decode(session['_saml2_subject_id'])
    except KeyError:
        return None