コード例 #1
0
from django.urls import path, include
from django.contrib import admin
from django.contrib.auth.views import login, logout
from chat.views import IndexView
from common import views

urlpatterns = [
    path('', IndexView.as_view(), name="index"),
    # path('accounts/login/', login, name='login'),
    path('accounts/login/user/', views.LoginView.as_view(), name='user_login'),
    path('accounts/login/user/<int:pk>/',
         views.UserProfileUpdateView.as_view(),
         name='profile_update'),
    path('accounts/logout/', logout),
    path('admin/', admin.site.urls),
    path("register/", views.RegisterView.as_view(), name="register"),
    path('chat/', include(('chat.urls', 'chat'), namespace='chat')),
]
コード例 #2
0
from chat.views import IndexView, MessagesListView
from django.urls.conf import path

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('<room_name>/', IndexView.as_view(), name='room'),
    path('api/messages/<room_name>/', MessagesListView.as_view()),
]
コード例 #3
0
ファイル: urls.py プロジェクト: Vkotl/Message-board
from django.conf.urls import url
from chat.views import IndexView, loginView, registerView, chat_room
from django.contrib.auth.decorators import login_required
# As of Django 1.10 it is impossible to reference views as: 'django.contrib.auth.views.logout' but is required to call
# them directly.
from django.contrib.auth.views import logout

# Updated for Django 2.0 to fix namespace exception from the inc
app_name = 'chat'

urlpatterns = [
    # redirect_field_name=None prevents Django from redirecting back to where it was called from.
    url(r'^$',
        login_required(IndexView.as_view(), redirect_field_name=None),
        name='index'),
    url('^login/$', loginView, name='login'),
    url('^register/$', registerView, name='register'),
    # The use of builtin logout allows the use of 'next_page' which automatically redirects.
    url(r'^logout/$', logout, name='logout', kwargs={'next_page': '/chat/'}),
    # url(r'^logout/$', 'django.contrib.auth.views.logout', name= 'logout', kwargs={'next_page': '/chat/'}),
    url(r'^(?P<user_id>[0-9]+)/$', chat_room, name='room'),
]
コード例 #4
0
ファイル: urls.py プロジェクト: ryanmckelvey/django-chat-app
from django.urls import path
from . import views
from chat.views import IndexView

urlpatterns = [
    #path('', views.index, name="index"),
    #path('chatroom/<int:chatroom_id>/', views.chatRoom, name="chat room")
    path('', IndexView.as_view())
]
コード例 #5
0
ファイル: urls.py プロジェクト: yu-shvets/Sonder_Blu
 # that way it can return a sensible "invalid key" message instead of a
 # confusing 404.
 url(r'^activate/(?P<activation_key>\w+)/$',
     ActivationView.as_view(),
     name='registration_activate'),
 url(r'^register/complete/$',
     TemplateView.as_view(
         template_name='registration/registration_complete.html'),
     name='registration_complete'),
 url(r'^register/closed/$',
     TemplateView.as_view(
         template_name='registration/registration_closed.html'),
     name='registration_disallowed'),
 url(r'^accounts/',
     include('registration.backends.default.urls', namespace='accounts')),
 url(r'^chat/$', IndexView.as_view(), name='chat'),
 url(r'^multichat/$', multichat_view, name='multichat'),
 url(r'^feed/$', feed_view, name='feed'),
 url(r'^create_post/$', PostCreateView.as_view(), name='create_post'),
 url(r'^create_comment/(?P<post_id>\d+)/$',
     CommentCreateView.as_view(),
     name='create_comment'),
 url(r'^create_answer/(?P<comment_id>\d+)/$',
     AnswerCreateView.as_view(),
     name='create_answer'),
 url(r'^feed/post_like/$', post_like, name='post_like'),
 url(r'^feed/comment_like/$', comment_like, name='comment_like'),
 url(r'^message_create/(?P<user_id>\d+)/$',
     MessageCreateView.as_view(),
     name='message_create'),
 url(r'^open_message/(?P<message_id>\d+)/$',
コード例 #6
0
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from chat.views import IndexView, Register, Logout, LoginView, AfterLogin, NotFoundView, ExistsView, MessageView

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^$', IndexView.as_view()),
    url(r'^sign_up/$', Register.as_view()),
    url(r'^log_out/$', Logout.as_view()),
    url(r'^log_in/$', LoginView.as_view()),
    url('not_found/', NotFoundView.as_view()),
    url('loged_in/', AfterLogin.as_view()),
    url('exists/', ExistsView.as_view()),
    url(r'^submit/$', MessageView.as_view()),
]
コード例 #7
0
"""realtimechat 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.contrib import admin
from django.urls import path, include
from chat.views import IndexView, SalaView

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('chat/<str:nome_sala>/', SalaView.as_view(), name='sala'),
]