示例#1
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 include, path
from django.conf import settings
from core.views import SignUpView, StudentFormView, ProfessionalFormView, ConsultationRequestView, DashboardView, StudentRequestListView, ProfessionalRequestListView, ajax_accept_request, StudentConsultationListView, ProfessionalConsultationListView
from django.urls import path
from django.contrib.auth import views as auth_views
from django.conf.urls import url

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('core.urls', namespace='core')),
    path('accounts/', include('allauth.urls')),
    path('accounts/signup/', SignUpView.as_view(), name="signup"),
    path('accounts/signup/student/',
         StudentFormView.as_view(),
         name="student_signup"),
    path('accounts/signup/professional/',
         ProfessionalFormView.as_view(),
         name="professional_signup"),
    path('student/request/',
         ConsultationRequestView.as_view(),
         name="consultation_request"),
    path('student/request_list/',
         StudentRequestListView.as_view(),
         name="student_request_list"),
    path('student/consultation_list/',
         StudentConsultationListView.as_view(),
         name="student_consultation_list"),
示例#2
0
from django.conf.urls import url

from core.views import SignUpView, SignInView, CurrentUserView

app_name = 'core'

urlpatterns = [
    url(r'^api/signup/$', SignUpView.as_view(), name='signup'),
    url(r'^api/signin/$', SignInView.as_view(), name='signin'),
    url(r'^api/users/me/$', CurrentUserView.as_view(), name='current_user'),
]
from django.urls import path
from core.views import SignUpView, ProfileView, image_upload_view
from . import views
urlpatterns = [
    path('signup/', SignUpView.as_view(), name='signup'),
    path('profile/<int:pk>/', ProfileView.as_view(), name='profile'),
    path('upload/', views.image_upload_view)
]
示例#4
0
文件: urls.py 项目: esicode/esi-web
from django.contrib import admin
admin.autodiscover()

from django.views.decorators.csrf import csrf_exempt

from core.views import HomeView
from core.views import SignUpView

from core.views import GroupListAPIView
from core.views import GroupAPIView
from core.views import GroupSubjectsAPIView
from core.views import UserAPIView
from core.views import UserGroupsAPIView
from core.views import UserPrivateAPIView
from core.views import SignUpAPIView

urlpatterns = patterns(
    '', url(r'^$', HomeView.as_view()), url(r'^signup', SignUpView.as_view()),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/groups/(?P<pk>[0-9])/subjects',
        csrf_exempt(GroupSubjectsAPIView.as_view())),
    url(r'^api/groups/(?P<pk>[0-9])', csrf_exempt(GroupAPIView.as_view())),
    url(r'^api/groups', csrf_exempt(GroupListAPIView.as_view())),
    url(r'^api/users/(?P<username>\w+)/private',
        csrf_exempt(UserPrivateAPIView.as_view())),
    url(r'^api/users/(?P<username>\w+)/groups',
        csrf_exempt(UserGroupsAPIView.as_view())),
    url(r'^api/users/(?P<username>\w+)', csrf_exempt(UserAPIView.as_view())),
    url(r'^api/signup', csrf_exempt(SignUpAPIView.as_view())))
示例#5
0
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.conf import settings
from core.views import ClientListView, SignUpView, SignInView, LogoutView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', ClientListView.as_view(), name='client_list'),
    url(r'^signup/', SignUpView.as_view(), name='signup'),
    url(r'^signin/', SignInView.as_view(), name='signin'),
    url(r'^logout/', LogoutView.as_view(), name='logout'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例#6
0
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.contrib import admin
from django.urls import path, include
from django.views.decorators.csrf import csrf_exempt  # New library

from todo_list.schema import schema
from core.views import SignUpView, PrivateGraphQLView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('oauth/', include('social_django.urls', namespace='social')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('signup/', SignUpView.as_view(), name="signup"),
    path('', include('core.urls'), name="core"),
    path('api/',
         csrf_exempt(PrivateGraphQLView.as_view(graphiql=True)),
         name="api"),
]