コード例 #1
0
ファイル: urls.py プロジェクト: rfadams/python-django-heroku
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.base import TemplateView

from accounts.views import CreateUserView, EditUserView, LoginUserView

urlpatterns = patterns('',
    url(r'^login/$', LoginUserView.as_view(), name='login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/login'}, name='logout'),

    url(r'^signup/$', CreateUserView.as_view(), name='signup'),
    url(r'^profile/$', TemplateView.as_view(template_name='accounts/profile.html'), name='profile'),
    url(r'^profile/edit/$', EditUserView.as_view(), name='edit'),
    url(r'^profile/edit/password/$', 'django.contrib.auth.views.password_change', {'template_name': 'generic/form.html', 'post_change_redirect': '/profile'}, name='password_change'),
)
コード例 #2
0
ファイル: urls.py プロジェクト: norwoodj/Forget-Your-Password
from django.conf.urls import patterns, url
from accounts.views   import CreateUserView


urlpatterns = patterns("",
  url(r"^login/$", "django.contrib.auth.views.login", {"template_name": "templates/login.html"}),
  url(r"^logout/$", "django.contrib.auth.views.logout_then_login"),
  url(r"^create/$", CreateUserView.as_view()),
)
コード例 #3
0
ファイル: urls.py プロジェクト: sunderrawat/buildmat
from django.urls import path
from accounts.views import CreateUserView

app_name = 'accounts'

urlpatterns = [
    path('create/', CreateUserView.as_view(), name='create'),
]
コード例 #4
0
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.base import TemplateView

from accounts.views import CreateUserView, EditUserView, LoginUserView

urlpatterns = patterns(
    '',
    url(r'^login/$', LoginUserView.as_view(), name='login'),
    url(r'^logout/$',
        'django.contrib.auth.views.logout', {'next_page': '/login'},
        name='logout'),
    url(r'^signup/$', CreateUserView.as_view(), name='signup'),
    url(r'^profile/$',
        TemplateView.as_view(template_name='accounts/profile.html'),
        name='profile'),
    url(r'^profile/edit/$', EditUserView.as_view(), name='edit'),
    url(r'^profile/edit/password/$',
        'django.contrib.auth.views.password_change', {
            'template_name': 'generic/form.html',
            'post_change_redirect': '/profile'
        },
        name='password_change'),
)
コード例 #5
0
"""BookShop URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path, include

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

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

]