Exemple #1
0
    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.contrib.auth.views import LogoutView
from django.views.generic import TemplateView
from accounts.views import UserRegistrationView, UserLoginView
from django.urls import path, include
from django.conf import settings
from blog.views import HomeView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('signup/', UserRegistrationView.as_view(), name='register'),
    path('login/', UserLoginView.as_view(), name='login'),
    path('logout/',
         LogoutView.as_view(next_page=settings.LOGOUT_REDIRECT_URL),
         name='logout'),
    path('', HomeView.as_view(), name='home'),
    path('', include('blog.urls'), name='blog'),
]
    HomeView,
    NewSubmissionView,
    SubmissionDetailView,
    NewCommentView,
    NewCommentReplyView,
    UpvoteSubmissionView,
    RemoveUpvoteSubmissionView,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name='home'),
    path('login/', LoginView.as_view(template_name='login.html'),
         name='login'),
    path('logout/', LogoutView.as_view(next_page='/login/'), name='logout'),
    path('register/', UserRegistrationView.as_view(),
         name='user-registration'),
    path('new-submission/', NewSubmissionView.as_view(),
         name='new-submission'),
    path('submission/<int:pk>/',
         SubmissionDetailView.as_view(),
         name='submission-detail'),
    path('new-comment/', NewCommentView.as_view(), name='new-comment'),
    path('new-comment-reply/',
         NewCommentReplyView.as_view(),
         name='new-comment-reply'),
    path('upvote/<int:pk>/',
         UpvoteSubmissionView.as_view(),
         name='upvote-submission'),
    path('upvote/<int:pk>/remove/',
         RemoveUpvoteSubmissionView.as_view(),
Exemple #3
0
    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.contrib.auth.views import LogoutView
from django.views.generic.base import RedirectView
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from task.views import TaskListView, TaskCreateOrUpdateView, TaskDetailView, TaskDeleteView
from accounts.views import UserRegistrationView, UserLoginView
from back_end import settings

urlpatterns = [
    path('admin/', admin.site.urls),

    # as_view() 初始化view class,返回句柄
    path('', RedirectView.as_view(url='task/')),
    path('task/', TaskListView.as_view()),
    path('task/create/', TaskCreateOrUpdateView.as_view()),
    path('task/<task_id>/', TaskDetailView.as_view()),
    path('task/<task_id>/update/', TaskCreateOrUpdateView.as_view()),
    path('task/<pk>/delete/', TaskDeleteView.as_view()),
    path('user/create/', UserRegistrationView.as_view()),
    path('user/login/', UserLoginView.as_view()),
    path('user/logout/', LogoutView.as_view())
]
if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from django.views.generic import TemplateView

from accounts.views import UserRegistrationView
from links.views import HomeView
from links.views import NewSubmissionView
from links.views import SubmissionDetailView
from links.views import NewCommentView
from links.views import NewCommentReplyView
from links.views import UpvoteSubmissionView
from links.views import RemoveUpvoteFromSubmissionView


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

    url(r'^$', HomeView.as_view(), name='home'),

    url(r'^login/$', login, kwargs={'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, kwargs={'next_page': '/login/'}, name='logout'),
    url(r'^register/$', UserRegistrationView.as_view(), name='user-registration'),

    url(r'^new-submission/$', NewSubmissionView.as_view(), name='new-submission'),
    url(r'^submission/(?P<pk>\d+)/$', SubmissionDetailView.as_view(), name='submission-detail'),
    url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'),
    url(r'new-comment-reply/$', NewCommentReplyView.as_view(), name='new-comment-reply'),

    url(r'^upvote/(?P<link_pk>\d+)/$', UpvoteSubmissionView.as_view(), name='upvote-submission'),
    url(r'^upvote/(?P<link_pk>\d+)/remove/$', RemoveUpvoteFromSubmissionView.as_view(), name='remove-upvote'),
]
Exemple #5
0
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
from accounts.views import UserRegistrationView
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from blog.views import NewBlogView
from blog.views import HomeView, UpdateBlogView, NewBlogPostView, UpdateBlogPostView, BlogPostDetailsView, SharePostWithBlog
from blog.views import StopSharingPostWithBlog, ShareBlogPostView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^new-user/$',
        UserRegistrationView.as_view(),
        name='user_registration'),
    url(r'^login/$', login, {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, {'next_page': '/login/'}, name='logout'),
    url(r'^blog/new/$', NewBlogView.as_view(), name='new-blog'),
    url(r'^blog/(?P<pk>\d+)/update/$',
        UpdateBlogView.as_view(),
        name='update-blog'),
    url(r'blog/post/new/$', NewBlogPostView.as_view(), name='new-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/update/$',
        UpdateBlogPostView.as_view(),
        name='update-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/$',
        BlogPostDetailsView.as_view(),
        name='blog-post-details'),
    url(r'blog/post/(?P<pk>\d+)/share/$',
        ShareBlogPostView.as_view(),
Exemple #6
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.views.generic import TemplateView
from accounts.views import UserRegistrationView
from blog.views import NewBlogView, HomeView
from django.contrib.auth.views import LoginView, LogoutView


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name="home"),
    path('about/', TemplateView.as_view(template_name="about.html"), name="about"),
    path('new-user/', UserRegistrationView.as_view(), name="user_registration"),
    path('blog/', include('blog.urls')),
    path('login/', LoginView.as_view(template_name = 'login.html'), name="login"),
    path('logout/', LogoutView.as_view(next_page = '/login/'), name="logout"),
]
Exemple #7
0
}

password_reset_configuration = {
    'post_reset_redirect': 'password_reset_done'
}

password_done_configuration = {
    'post_reset_redirect': 'password_reset_complete'
}

urlpatterns = [
    url(r'^' + BASE_URL + 'password-reset/$', auth_views.password_reset, password_reset_configuration, name='password_reset'),
    url(r'^' + BASE_URL + 'password-reset/done/$', auth_views.password_reset_done, name='password_reset_done'),
    url(r'^' + BASE_URL + 'password-reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', auth_views.password_reset_confirm, password_done_configuration, name='password_reset_confirm'),
    url(r'^' + BASE_URL + 'password-reset/completed/$', auth_views.password_reset_complete, name='password_reset_complete'),
    url(r'^' + BASE_URL + 'admin/', admin.site.urls),
    url(r'^' + BASE_URL + 'login/$', auth_views.login, login_configuration, name='login'),
    url(r'^' + BASE_URL + 'logout/$', auth_views.logout, logout_configuration, name='logout'),
    url(r'^' + BASE_URL + 'register/$', UserRegistrationView.as_view(), name='user_registration'),
    url(r'^' + BASE_URL + 'account/$', UserUpdateView.as_view(), name='user_account'),
    url(r'^' + BASE_URL + 'api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^' + BASE_URL + 'hydroshare/', include('hydroshare.urls', namespace='hydroshare')),
    url(BASE_URL, include('dataloaderinterface.urls')),
    url(BASE_URL, include('dataloaderservices.urls'))
]

# if settings.DEBUG:
#     import debug_toolbar
#     urlpatterns = [
#         url(r'^__debug__/', include(debug_toolbar.urls)),
#     ] + urlpatterns
Exemple #8
0
    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, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from .views import home, main
from accounts.views import UserRegistrationView
from doKonect import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', home, name='home'),
    url(r'^main/', main, name='main'),
    url(r'^referral/', include('doctor_referral.urls', namespace='referral')),
    url(r'^clinic/', include('clinic.urls', namespace='clinic')),
    url(r'^patients/', include('patients.urls', namespace='patients')),
    url(r'^api/referral/',
        include('doctor_referral.api.urls', namespace='referral-api')),
    url(r'^api/patients/',
        include('patients.api.urls', namespace='patients-api')),
    url(r'^', include('django.contrib.auth.urls')),
    url(r'^register/', UserRegistrationView.as_view(), name='register'),
    url(r'^profiles/', include('accounts.urls', namespace='profiles')),
    url(r'login_success/$', views.login_success, name='login_success')
]

if settings.DEBUG:
    urlpatterns += (static(settings.STATIC_URL,
                           document_root=settings.STATIC_ROOT))
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from accounts.views import UserRegistrationView
from blog.views import NewBlogView
from blog.views import HomeView
from blog.views import UpdateBlogView
from blog.views import NewBlogPostView
from blog.views import UpdateBlogPostView
from blog.views import BlogPostDetailsView
from blog.views import SharePostWithBlog
from blog.views import StopSharingPostWithBlog
from blog.views import ShareBlogPostView


urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^new-user/$', UserRegistrationView.as_view(), name='user_registration'),
    url(r'^login/$', login, {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, {'next_page': '/login/'}, name='logout'),

    url(r'^blog/new/$', NewBlogView.as_view(), name='new-blog'),
    url(r'^blog/(?P<pk>\d+)/update/$', UpdateBlogView.as_view(), name='update-blog'),
    url(r'blog/post/new/$', NewBlogPostView.as_view(), name='new-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/update/$', UpdateBlogPostView.as_view(), name='update-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/$', BlogPostDetailsView.as_view(), name='blog-post-details'),
    url(r'blog/post/(?P<pk>\d+)/share/$', ShareBlogPostView.as_view(), name='share-blog-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/share/to/(?P<blog_pk>\d+)/$', SharePostWithBlog.as_view(), name='share-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/stop/share/to/(?P<blog_pk>\d+)/$', StopSharingPostWithBlog.as_view(), name='stop-sharing-post-with-blog'),
]
Exemple #10
0
from accounts.views import UserRegistrationView
from django.conf.urls import url
from django.contrib.auth import views

urlpatterns = [
    url(r'^register/$', UserRegistrationView.as_view(), name="register"),
    url(r'^login/$', views.login, {"template_name": "accounts/login.html"}, name="login"),
    url(r'^logout/$', views.logout, {"next_page": "/"}, name="logout"),
]
Exemple #11
0
from django.contrib.auth.views import logout
from django.views.generic import TemplateView

from accounts.views import UserRegistrationView
from links.views import HomeView
from links.views import NewSubmissionView
from links.views import SubmissionDetailView
from links.views import NewCommentView
from links.views import NewCommentReplyView
from links.views import UpvoteSubmissionView
from links.views import RemoveUpvoteFromSubmissionView


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

    url(r'^$', HomeView.as_view(), name='home'),

    url(r'^login/$', login, kwargs={'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, kwargs={'next_page': '/login/'}, name='logout'),
    url(r'^register/$', UserRegistrationView.as_view(), name='user-registration'),

    url(r'^new-submission/$', NewSubmissionView.as_view(), name='new-submission'),
    url(r'^submission/(?P<pk>\d+)/$', SubmissionDetailView.as_view(), name='submission-detail'),
    url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'),
    url(r'new-comment-reply/$', NewCommentReplyView.as_view(), name='new-comment-reply'),

    url(r'^upvote/(?P<link_pk>\d+)/$', UpvoteSubmissionView.as_view(), name='upvote-submission'),
    url(r'^upvote/(?P<link_pk>\d+)/remove/$', RemoveUpvoteFromSubmissionView.as_view(), name='remove-upvote'),
]
Exemple #12
0
from django.urls import path
from accounts.views import UserRegistrationView, UserLoginView

urlpatterns = [
    path('signup/', UserRegistrationView.as_view()),
    path('login/', UserLoginView.as_view()),
]
Exemple #13
0
from django.conf.urls import url

from accounts.views import UserRegistrationView

urlpatterns = [
    # User registration URL
    url(
        r'^register',
        UserRegistrationView.as_view({'post': 'create'}, ),
        name='user-registration',
    ),
]
Exemple #14
0
from .views import home, SearchView

from accounts.views import UserRegistrationView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TweetListView.as_view(), name='home'),
    path('search/', SearchView.as_view(), name='search'),
    path('tags/', include(('hashtags.urls', 'hashtags'),
                          namespace='hashtags')),
    path('tweet/', include(('tweets.urls', 'tweets'), namespace='tweets')),
    path('api/tweet/',
         include(('tweets.api.urls', 'tweets/api'), namespace='tweets-api')),
    path('api/search/', SearchAPIView.as_view(), name='search-api'),
    path(
        'api/hashtag/',
        include(('hashtags.api.urls', 'hashtags/api'),
                namespace='hashtags-api')),
    path(
        'api/',
        include(('accounts.api.urls', 'accounts/api'),
                namespace='profiles-api')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('accounts/register/', UserRegistrationView.as_view(),
         name='Register'),
    path('', include(('accounts.urls', 'accounts'), namespace='profiles')),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
Exemple #15
0
"""blueblog 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.conf.urls import url
from django.contrib import admin
from django.views.generic import TemplateView

from accounts.views import UserRegistrationView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', TemplateView.as_view(template_name='base.html'), name='home'),
    url(r'^new-user/$', UserRegistrationView.as_view(), name='user_registration'),
]
Exemple #16
0
          template_name='registration/password_reset_form.html',
          form_class=UserPasswordResetForm,
      ),
      name='password_reset'),
 path('password_reset_confirm/<uidb64>/<token>',
      PasswordResetConfirmView.as_view(
          template_name='registration/password_reset_confirm.html',
          form_class=UserPasswordResetConfirmForm),
      name='password_reset_confirm'),
 path('password_change/',
      PasswordChangeView.as_view(
          template_name="registration/password_change_form.html",
          form_class=UserPasswordChangeForm),
      name='password_change'),
 path('activate/<uidb64>/<token>/', activate, name='activate'),
 path('registration/', UserRegistrationView.as_view(), name='registration'),
 path('profile/', UserProfileView.as_view(), name='profile'),
 path('profile/update/<int:pk>/',
      UserUpdateView.as_view(),
      name='profile-update'),
 path('profile/delete/<int:pk>/',
      UserDeleteView.as_view(),
      name='profile-delete'),
 path('profile/companies/', CompanyListView.as_view(), name='companies'),
 path('profile/managers/',
      ManagerListView.as_view(template_name='managers/manager_list.html'),
      name='managers'),
 path('profile/companies/add/',
      CompanyCreateView.as_view(),
      name='companies-add'),
 path('profile/companies/update/<slug:slug>/',
Exemple #17
0
        ArticleCreateUpdateView.as_view()),  #게시판 수정
    #url(r'^article/(?P<article_id>\d+)/delete', ArticleDeleteView.as_view()), #삭제
    url(r'^comment/(?P<pk>\d+)/update/$', CommentUpdate.as_view()),
    url(r'^comment/(?P<pk>\d+)/delete/$', CommentDelete.as_view()),
    url(r'^article/(?P<pk>\d+)/comment/$',
        add_comment_to_post,
        name='add_comment_to_post'),
    url(r'^article/comment/', post_create),
    url(r'^article/(?P<article_id>\d+)/$',
        ArticleDetailView.as_view()),  #게시판 세부정보
    url(r'^article/create', ArticleCreateUpdateView.as_view()),  #게시물 만들기   
    #url(r'^article', add_comment, name='add_comment'),
    url(r'^article', ArticleListView.as_view()),  #게시판 전체 출력
    url(r'^index', index_get, name='index_get'),
    url(r'^accounts/mypage/', user_info, name='user_info'),  #마이페이지
    url(r'^accounts/create/', UserRegistrationView.as_view()),  #회원가입
    url(r'^accounts/login/', UserLoginView.as_view()),  #로그인
    url(r'^accounts/logout/', LogoutView.as_view()),  #로그아웃

    #url(r'^accounts/update/' views.update, name='update'),
    #url(r'^accounts/mypage', views.userinfo, name="mypage"),
    url(r'^admin/', admin.site.urls),

    #FBV방식
    #url(r'^hello/<to>', hello),
    #url(r'^article/', list_article),
    #url(r'^article/create/', create_or_update_article, {'article_id': None}), # {'article_id':None} 필수
    #url(r'^article/<article_id>/', detail_article),
    #url(r'^article/<article_id>/update/', create_or_update_article),
]
Exemple #18
0
    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.views.generic import TemplateView
from accounts.views import UserRegistrationView
from django.contrib.auth.views import LoginView, LogoutView
from blog.views import NewBlogView, UpdateBlogView, NewBlogPostView, UpdateBlogPostView, BlogPostDetailsView, SharePostWithBlog, StopSharingPostWithBlog

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TemplateView.as_view(template_name='base.html'), name='home'),
    path('new-user/', UserRegistrationView.as_view(),
         name='user_registration'),
    path('login/',
         LoginView.as_view(), {'template_name': 'login.>html'},
         name='login'),
    path('logout/',
         LogoutView.as_view(), {'next_page': '/login/'},
         name='logout'),
    path('blog/new/', NewBlogView.as_view(), name='new-blog'),
    path('blog/<int:pk>/update/', UpdateBlogView.as_view(),
         name='update-blog'),
    path('blog/post/new/', NewBlogPostView.as_view(), name='new-blog-post'),
    path('blog/post/<int:pk>/update/',
         UpdateBlogPostView.as_view(),
         name='update-blog-post'),
    path('blog/post/<int:pk>/',
from accounts.views import UserRegistrationView
from django.conf.urls import url
from django.contrib.auth import views as auth_view

app_name = 'accounts'

urlpatterns = [
    url(r'^register/$', UserRegistrationView.as_view(), name="register"),
    url(r'^login/$', auth_view.LoginView.as_view(), {"template_name": "accounts/login.html"}, name="login"),
    url(r'^logout/$', auth_view.LogoutView.as_view(), {"next_page": "/"}, name="logout"),
]
Exemple #20
0
from django.urls import path
from accounts.views import UserRegistrationView, activate
from django.contrib.auth.views import LoginView, LogoutView

# urls
urlpatterns = [
    path("register/", UserRegistrationView.as_view(), name="user_register"),
    path("activate/<uidb64>/<token>", activate, name="activate"),
    path("login/",
         LoginView.as_view(template_name="accounts/login.html"),
         name="login"),
    path("logout/",
         LogoutView.as_view(template_name="accounts/logout.html"),
         name="logout"),
]
Exemple #21
0
    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 accounts.views import UserRegistrationView
from django.views.generic import TemplateView
from django.contrib.auth.views import LoginView, LogoutView
from links.views import NewSubmissionView, SubmissionDetailView, NewCommentView
from links.views import AllLinkListView, NewCommentReplyView
from links.views import UpvoteSubmissionView, RemoveUpvoteFromSubmissionView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', AllLinkListView.as_view(), name='home'),
    path('new-user/', UserRegistrationView.as_view(), name='user-registration'),
    path('login/', LoginView.as_view(template_name='accounts/login.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('new-submission/', NewSubmissionView.as_view(), name='new-submission'),
    path('submission/<int:pk>/', SubmissionDetailView.as_view(), name='submission-detail'),
    path('new-comment/', NewCommentView.as_view(), name='new-comment'),
    path('new-comment-reply/', NewCommentReplyView.as_view(), name='new-comment-reply'),
    path('upvote/<int:link_pk>/', UpvoteSubmissionView.as_view(), name='upvote-submission'),
    path('upvote/<int:link_pk>/remove/', RemoveUpvoteFromSubmissionView.as_view(), name='remove-upvote'),
]