The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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.conf.urls.static import static from a_pedal import settings from django.contrib import admin from django.urls import path, include from users.views import Login, SignUp, GoogleLogin, GoogleSignUp urlpatterns = [ path('admin/', admin.site.urls), path('perfil/', include(('users.urls', 'users'), namespace='perfil')), path('login/', Login.as_view(), name='login'), path('signup/', SignUp.as_view(), name='signup'), path('authenticate_google/', GoogleLogin.as_view(), name="login_google"), path('sign_up_google/', GoogleSignUp.as_view(), name="sign_up_google"), path('punto/', include(('puntos.urls', 'puntos'), namespace='punto')), path('plan/', include(('planes.urls', 'planes'), namespace='plan')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Logout, Signup, ActivateUser, ResetPassword, FollowUserToggle, ProfileImage, ) urlpatterns = [ # User Object url(r'^$', UserList.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', UserDetail.as_view(), name='detail'), # User Follow url(r'^(?P<pk>\d+)/follow/$', FollowUserToggle.as_view(), name='follow'), # User profile image url(r'^(?P<pk>\d+)/profile-img/$', ProfileImage.as_view(), name='profile-img'), # User Login/Signup url(r'^login/$', Login.as_view(), name='login'), url(r'^logout/$', Logout.as_view(), name='logout'), url(r'^signup/$', Signup.as_view(), name='signup'), url(r'^activate/$', ActivateUser.as_view(), name='activate'), url(r'^google_login/$', GoogleLogin.as_view(), name='google-login'), url(r'^facebook_login/$', FacebookLogin.as_view(), name='facebook-login'), url(r'^password/$', ResetPassword.as_view(), name='password'), ]
from django.contrib import admin from django.urls import path, include from rest_framework.routers import DefaultRouter from rest_framework_jwt.views import verify_jwt_token from django.conf import settings from django.conf.urls.static import static from users.views import FacebookLogin, KakaoLogin, GoogleLogin router = DefaultRouter() urlpatterns = [ path(r'', include(router.urls)), path(r'admin/', admin.site.urls), path(r'rest-auth/', include('rest_auth.urls')), path(r'rest-auth/registration/', include('rest_auth.registration.urls')), path(r'upload/', include('upload.urls')), path(r'chat/', include('chat.urls')), path(r'users/', include('users.urls')), path(r'verify/', verify_jwt_token), path(r'rest-auth/facebook/', FacebookLogin.as_view(), name='fb_login'), path(r'rest-auth/kakao/', KakaoLogin.as_view(), name='kakao_login'), path(r'rest-auth/google/', GoogleLogin.as_view(), name='google_login'), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, include from users.views import GoogleLogin urlpatterns = [ path('', include('djoser.urls')), path('', include('djoser.urls.authtoken')), path('', include('rest_auth.urls')), path('', include('allauth.urls')), path('google/', GoogleLogin.as_view(), name='google_login'), ]
from apartments.views import ApartmentView from users.social_views import FacebookConnect, TwitterConnect from users.views import FacebookLogin, GoogleLogin, UserView, null_view router = SimpleRouter() router.register(r'apartments', ApartmentView) router.register(r'users', UserView) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'api/', include(router.urls)), url(r'^rest-auth/', include('rest_auth.urls')), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), url(r'^rest-auth/registration/account-email-verification-sent/', null_view, name='account_email_verification_sent'), url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', null_view, name='account_confirm_email'), url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login'), url(r'^rest-auth/google/$', GoogleLogin.as_view(), name='twitter_login'), url(r'^rest-auth/facebook/connect/$', FacebookConnect.as_view(), name='fb_connect'), url(r'^rest-auth/twitter/connect/$', TwitterConnect.as_view(), name='twitter_connect'), url(r'^accounts/', include('allauth.urls'), name='socialaccount_signup'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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.conf.urls import url from users.views import GoogleLogin from users.views import CustomUserViewSet from school.views import SchoolViewSet from game_room.views import GameRoomViewSet, TeamViewSet, QueueUp from rest_framework.routers import DefaultRouter urlpatterns = [ path('admin/', admin.site.urls), url(r'^rest-auth/', include('rest_auth.urls')), url(r'^account/', include('allauth.urls')), path('auth/google', GoogleLogin.as_view(), name='google_login'), path('queue_up', QueueUp.as_view(), name='queue up') ] router = DefaultRouter() router.register(r'users', CustomUserViewSet, basename='user') router.register(r'schools', SchoolViewSet, basename='school') router.register(r'game_room', GameRoomViewSet, basename='game_room') router.register(r'team', TeamViewSet, basename='team') urlpatterns += router.urls
from django.urls import path, include from users.views import GoogleLogin, FacebookLogin app_name = 'users' urlpatterns = [ path('auth/', include('dj_rest_auth.urls'), name='auth'), path('social-login/google/', GoogleLogin.as_view(), name='google_login'), path('social-login/facebook/', FacebookLogin.as_view(), name='facebook_login'), path('registration/', include('dj_rest_auth.registration.urls'), name='registration') ]