from index.group.views import GroupViewSet from index.lecture_hall.views import LectureHallViewSet from index.lesson.views import LessonViewSet from index.teacher.views import TeacherViewSet from index.training_direction.views import TrainingDirectionViewSet from index.building.views import BuildingViewSet from index.flow.views import FlowViewSet from rest_auth.views import ( LoginView, LogoutView, PasswordChangeView, UserDetailsView, ) rest_auth_urls = [ url(r'^login/$', LoginView.as_view(), name='rest_login'), url(r'^logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), url(r'^user/$', UserDetailsView.as_view(), name='user'), ] router = routers.DefaultRouter() router.register(r'discipline', DisciplineViewSet, basename='Discipline') router.register(r'education_plan', EducationPlanViewSet, basename='EducationPlan') router.register(r'group', GroupViewSet, basename='Group') router.register(r'lecture_hall', LectureHallViewSet, basename='LectureHall') router.register(r'lesson', LessonViewSet, basename='Lesson')
from django.conf.urls import patterns, url from rest_auth import views from axes.decorators import watch_login from rest_auth.views import ( LoginView, LogoutView, UserDetailsView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView ) urlpatterns = [ # URLs that do not require a session or valid token url(r'^password/reset/$', PasswordResetView.as_view(), name='rest_password_reset'), url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), url(r'^login/$', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. url(r'^logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'), url(r'^password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), url(r'^handlecsv/$',views.handlecsv,name='handlecsv'), ]
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 rest_auth.registration.views import RegisterView from rest_auth.views import LogoutView, LoginView urlpatterns = [ path('admin/', admin.site.urls), path( 'api/', include([ path('users/', include('users.urls')), path('registration/', RegisterView.as_view()), path('login/', LoginView.as_view()), path('logout/', LogoutView.as_view()), ])), ]
rest.ProjectMessagesViewSet, base_name="messages") results_router = NestedDefaultRouter(projects_router, "series", lookup="series", trailing_slash=True) results_router.include_format_suffixes = False results_router.register("results", rest.SeriesResultsViewSet, base_name="results") schema_view = get_schema_view(title="API schema") urlpatterns = _build_urls() dispatch_module_hook("api_url_hook", urlpatterns=urlpatterns) urlpatterns += [ url( r"^v1/projects/by-name/(?P<name>[^/]*)(?P<tail>/.*|$)", rest.ProjectsByNameView.as_view(), ), url(r"^v1/users/login/$", LoginView.as_view(), name="rest_login"), url(r"^v1/users/logout/$", LogoutView.as_view(), name="rest_logout"), url(r"^v1/", include(router.urls)), url(r"^v1/", include(projects_router.urls)), url(r"^v1/", include(results_router.urls)), url(r"^v1/schema/$", schema_view), # Use the base class's handler by default url(r".*", views.APIView.as_view()), ]
login_view = swagger_auto_schema(operation_summary='Login a user', operation_description=''' Check the credentials and return the REST Token if the credentials are valid and authenticated. Calls Django Auth login method to register User ID in Django session framework. ''', operation_id='user-login', methods=['POST'], tags=['User Accounts'], security=[], responses={ status.HTTP_200_OK: LoginSerializer, status.HTTP_400_BAD_REQUEST: 'Username/Password is required.' })(LoginView.as_view()) logout_view = swagger_auto_schema( operation_summary='Logout authenticated user', operation_description=''' Logout an authenticated user by deleting the Token object assigned to the current User object. **Note:** It accepts/returns nothing. ''', operation_id='user-logout', methods=['GET', 'POST'], tags=['User Accounts'], responses={status.HTTP_200_OK: 'Successfully logged out.'})(LogoutView.as_view())
from django.conf.urls import url from rest_auth.registration.views import RegisterView from rest_auth.views import LoginView from applications.accounts import views from applications.accounts.views import UserVerifyJWT, ChangePasswordView urlpatterns = [ url(r'^signup/', RegisterView.as_view(), name='account_signup'), url(r'^login/', LoginView.as_view(), name='account_login'), url(r'^change-password/', ChangePasswordView.as_view(), name='change_password'), url(r'^api-token-verify/', UserVerifyJWT.as_view()), url(r'^profile/$', views.UserProfileView.as_view(), name='user_profile'), url(r'^destroy/$', views.UserProfileDestroyView.as_view(), name='destroy') ]
from rest_auth.views import LoginView from rest_auth.registration.views import RegisterView from django.urls import path from django.conf.urls import include, url from django.views.decorators.csrf import csrf_exempt urlpatterns = [ # path('', include('rest_auth.urls')), # path('registration/', include('rest_auth.registration.urls')), path("api-login/", csrf_exempt(LoginView.as_view()), name="api-login"), path("api-register/", csrf_exempt(RegisterView.as_view()), name="api-register"), url(r'^rest-auth/', include('rest_auth.urls')), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), ]
response_serializer = RestAuthCommonResponseSerializer() class PasswordResetConfirmViewSchema(CustomAutoSchema): request_serializer = PasswordResetConfirmSerializer() response_serializer = RestAuthCommonResponseSerializer() class PasswordChangeViewSchema(CustomAutoSchema): request_serializer = PasswordChangeSerializer() response_serializer = RestAuthCommonResponseSerializer() urlpatterns = [ url(r'^login/$', LoginView.as_view(schema=LoginViewSchema()), name='rest_login'), url(r'^logout/$', LogoutView.as_view(schema=LogoutViewSchema()), name='rest_logout'), url(r'^password/reset/$', PasswordResetView.as_view(schema=PasswordResetViewSchema()), name='rest_password_reset'), url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view( schema=PasswordResetConfirmViewSchema()), name='rest_password_reset_confirm'), url(r'^password/change/$', PasswordChangeView.as_view(schema=PasswordChangeViewSchema()), name='rest_password_change'), ]
from django.conf.urls import patterns, url from rest_auth.views import ( LoginView, LogoutView, UserDetailsView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView, ) urlpatterns = patterns( "", # URLs that do not require a session or valid token url(r"^password/reset", PasswordResetView.as_view(), name="rest_password_reset"), url(r"^confirm/password/reset", PasswordResetConfirmView.as_view()), # url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'), url( r"^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$", PasswordResetConfirmView.as_view(), name="password_reset_confirm", ), url(r"^login", LoginView.as_view(), name="rest_login"), # URLs that require a user to be logged in with a valid session / token. url(r"^logout", LogoutView.as_view(), name="rest_logout"), url(r"^user/$", UserDetailsView.as_view(), name="rest_user_details"), url(r"^password/change", PasswordChangeView.as_view(), name="rest_password_change"), )
from allauth.account.views import confirm_email from django.conf.urls import url from rest_auth.registration.views import VerifyEmailView from rest_auth.views import LoginView, LogoutView, PasswordResetConfirmView, PasswordChangeView from rest_framework.routers import DefaultRouter from per_auth import views from per_auth.views import CustomizedPasswordResetView, CustomizedRegisterView, PersonViewSet # app_name = 'per_auth' router = DefaultRouter() router.register(r'person', PersonViewSet, base_name='person') urlpatterns = router.urls + [ url(r'^login/?$', LoginView.as_view(), name='login'), url(r'^register/?$', CustomizedRegisterView.as_view(), name='register'), url(r'^logout/?$', LogoutView.as_view(), name='logout'), url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'), url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', confirm_email, name='account_confirm_email'), url(r'^activate/?$', views.activate, name='activate'), url(r'^password/forgot/?$', CustomizedPasswordResetView.as_view(), name='forgot_password'), url(r'^password/reset/?$', PasswordResetConfirmView.as_view(), name='reset_password'), url(r'^password/change/?$',
from django.urls import path from rest_auth.views import LoginView, LogoutView from rest_framework.routers import DefaultRouter from .views import UserViewSet, CheckAuthView router = DefaultRouter() router.register('users', UserViewSet) urlpatterns = [ path('users/login/', LoginView.as_view()), path('users/logout/', LogoutView.as_view()), path('users/check-auth/', CheckAuthView().as_view()) ] urlpatterns += router.urls
from .views import DashboardTemplateView from apps.user.api.api_rest import UserViewSet from apps.task.api.api_rest import TaskViewSet router = routers.DefaultRouter() router.register(r'users', UserViewSet) router.register(r'task', TaskViewSet) routerPublic = routers.DefaultRouter() urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/', include('allauth.urls')), url(r'^django-des/', include(des_urls)), # API url(r'^api/accounts/login/$', LoginView.as_view(), name='login'), url(r'^api/accounts/logout/$', LogoutView.as_view(), name='logout'), url(r'^api/accounts/register/$', RegisterView.as_view(), name='logout'), url(r'^api/', include(router.urls)), url(r'^api/public/', include(routerPublic.urls)), url(r'^docs/', include_docs_urls(title='API Doc skol', description="Status code: http://www.django-rest-framework.org/api-guide/status-codes/", public=True, permission_classes=[AllowAny])), url(r'', login_required(DashboardTemplateView.as_view())), ] if settings.DEBUG: urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns
from rest_auth.views import LoginView from django.urls import path from .api import PostList, post_like, profile_follow, ProfileList, PostImagesList urlpatterns = [ #AUTH URLS path('api/login', LoginView.as_view()), #POST URLS path('api/posts', PostList.as_view()), path('api/post/like/<post_id>', post_like), path('api/posts/images/<profile_id>', PostImagesList.as_view()), #PROFILE URLS path('api/profiles', ProfileList.as_view()), path('api/profiles/follow/<profile_id>', profile_follow), path('api/profiles/unfollow/<profile_id>', profile_follow, {'follow':False}), ]
from django.contrib import admin from django.conf.urls import include, url from rest_auth.views import (LoginView,LogoutView,UserDetailsView, PasswordChangeView,PasswordResetView, PasswordResetConfirmView ) from django.views.decorators.csrf import csrf_exempt from django.views.generic import TemplateView, RedirectView # urlpatterns = [ # path('admin/', admin.site.urls), # ] urlpatterns = [ # url(r'^api/', include('rest_auth.urls')) url(r'login/', csrf_exempt(LoginView.as_view()),name='login'), url(r'logout/', LogoutView.as_view(),name='logout'), url(r'user/', UserDetailsView.as_view(),name='user_details'), url(r'password/change/',PasswordChangeView.as_view(),name='password_change'), url(r'password/reset/confirm/',PasswordResetConfirmView.as_view(),name='password_reset_confirm'), url(r'password/reset/',PasswordResetView.as_view(),name='password_reset') ]
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 rest_auth.views import LoginView from app1.views import IndexTemplateView from app1.views import SignUp from app1.views import Logout from app2.views import Greeting from app3.views import Message from rest_framework.authtoken.views import obtain_auth_token from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('', IndexTemplateView.as_view(), name='index'), path('admin/', admin.site.urls), path('api/v1/user/signup/', SignUp.as_view(), name='signup'), path('api/v1/login/', LoginView.as_view(), name='login'), path('api/v1/logout/', Logout.as_view(), name='apilogout'), path('api/v1/greeting/', Greeting.as_view(), name='greeting'), path('api/v1/message/', Message.as_view(), name='message'), path('api/v1/api-token-auth/', obtain_auth_token, name='api_token_auth'), #pass parameter as username and password # if user is created it gives the token that we can use for app2 and app3 API ]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
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.contrib import admin from django.urls import path, include, re_path from django.conf.urls import url from django.views.generic import TemplateView from rest_auth.views import LoginView from rest_auth.registration.views import RegisterView urlpatterns = [ path('api-auth/', include('rest_framework.urls')), path('rest-auth/login/', LoginView.as_view(), name="rest_login"), path('rest-auth/registration/', RegisterView.as_view(), name="rest_register"), path('admin/', admin.site.urls), path('accounts/', include('accounts.urls')), path('matches/', include('matches.urls')), url(r'^$', TemplateView.as_view(template_name='index.html')), ]
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from rest_auth.views import LoginView from core.views import BankAPIView, CreateBankAPIView, CustomerAPIView, CreateCustomerAPIView, ContractAPIView, \ CreateContractAPIView, PaymentAPIView, CreatePaymentAPIView urlpatterns = [ path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), path('api/', include('rest_framework.urls')), path('login/', LoginView.as_view(), name='login'), # bank url's path('list/bank/', BankAPIView.as_view(), name='list-bank'), path('create/bank/', CreateBankAPIView.as_view(), name='create-bank'), # customer url's path('list/customer/', CustomerAPIView.as_view(), name='list-customer'), path('create/customer/', CreateCustomerAPIView.as_view(), name='create-customer'), # contract url's path('list/contract/', ContractAPIView.as_view(), name='list-contract'), path('create/contract/', CreateContractAPIView.as_view(),
from rest_framework_jwt.views import verify_jwt_token from accounts import views as accountsView from accounts.views import UserDetailsView, account_login from chatrbaazan import settings from shop import serializers urlpatterns = [ url(r'^jet/', include('jet.urls', 'jet')), # Django JET URLS url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')), # Django JET dashboard URLS url(r'^ckeditor/', include('ckeditor_uploader.urls')), path('admin/', admin.site.urls), path('accounts/login/', account_login, name="account_login"), url(r'^', include('shop.urls')), path('auth/login/', LoginView.as_view()), path('auth/registration/', include('rest_auth.registration.urls')), re_path(r'^auth/account-confirm-email/', VerifyEmailView.as_view(), name='account_email_verification_sent'), url(r'^rest-auth/registration/account-confirm-email/(?P<key>[-:\w]+)/$', allauthemailconfirmation, name="account_confirm_email"), path('auth/refresh/', refresh_jwt_token), path('auth/verify/', verify_jwt_token), url(r'^auth/password/reset/$', accountsView.PasswordResetView.as_view(), name='rest_password_reset'), url(r'^auth/password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', accountsView.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
from categories.models import Category from django.contrib import admin from django.urls import path from tasks.views import TaskView from categories.views import CategoryView from users.views import UserView from rest_auth.views import LoginView from rest_auth.registration.views import RegisterView urlpatterns = [ path('admin/', admin.site.urls), path('signin', LoginView.as_view(), name='rest_login'), path('signup', RegisterView.as_view(), name='rest_register'), path( 'user/<int:pk>', UserView.as_view({ 'get': 'retrieve', 'put': 'update', 'delete': 'destroy' })), path('task/create', TaskView.as_view({'post': 'create'})), path( 'task/<int:pk>', TaskView.as_view({ 'get': 'retrieve', 'put': 'update', 'delete': 'destroy' })), path('task>', TaskView.as_view({'get': 'list'})), path( 'category/<int:pk>',
) from .api import UserAPI router = routers.SimpleRouter() router.register(r"users", UserAPI) app_name = "users" rest_auth_overrides = [ # URLs that do not require a session or valid token path("password/reset/", PasswordResetView.as_view(), name="rest_password_reset"), path( "password/reset/confirm/", PasswordResetConfirmView.as_view(), name="rest_password_reset_confirm", ), path("login/", LoginView.as_view(), name="rest_login"), # URLs that require a user to be logged in with a valid session / token. path("logout/", LogoutView.as_view(), name="rest_logout"), path("me/", UserDetailsView.as_view(), name="rest_user_details"), path("password/change/", PasswordChangeView.as_view(), name="rest_password_change"), ] urlpatterns = ( [path("register/", include("rest_auth.registration.urls"))] + rest_auth_overrides + router.urls )
from django.conf.urls import url from django.contrib import admin from django.urls import include from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token from rest_auth.views import LoginView, LogoutView from login.views import UserRegistration app_name = "login" urlpatterns = [ url(r'^register/$', UserRegistration.as_view(), name="register"), url(r'^login/$', LoginView.as_view(), name="login"), url(r'^logout/$', LogoutView.as_view(), name="logout"), ]
def empty_view(request): return HttpResponse('') urlpatterns = [ # Inbuilt Endpoints path('admin/', admin.site.urls), # Rest Auth Endpoints path('authentication/password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), path('authentication/password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), path('authentication/login/', LoginView.as_view(), name='rest_login'), path('authentication/logout/', LogoutView.as_view(), name='rest_logout'), path('authentication/password/change/', PasswordChangeView.as_view(), name='rest_password_change'), # The following URL actually has no functionality. When sending an email to a user regarding their requested # password change, we need a url with the name 'password_reset_confirm' so that we can use it as a template to # create the actual URL that the user should be redirected to. This actual URL needs to point to the frontend, # not back to the Django backend. This pointing is done based on the 'Domain Name' you provide in the 'sites' # table. You can set the domain name by going to the admin panel and looking for the sites. Please refer to the # rest-auth documentation for more details. path('password-reset/<uidb64>/<token>/', empty_view, name='password_reset_confirm'),
############################## # All ############################## urlpatterns = [ # enable the admin interface url(r'^admin/', admin.site.urls), url(r'^stats/stacksampler', StackSamplerView.as_view()), url(r'^api/v3/auth/password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), url(r'^api/v3/auth/login/$', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. url(r'^api/v3/auth/logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^api/v3/auth/password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), # Rest Auth requires auth urls. If we remove this, then we'll get an error # around NoReverseMatch # TODO: Work out how to avoid external access to these URLs if possible url(r'^', include('django.contrib.auth.urls')), url(r'^api/v3/', include('zconnect.urls')), url(r'^api/v3/', include('zconnect.zc_billing.urls')),
PasswordChangeView) from rest_auth.registration.views import RegisterView from . import views urlpatterns = [ path('api/sign_s3/', views.SignS3View.as_view(), name='sign_s3'), path('api/recipes/', views.RecipeListCreate.as_view(), name='recipe_list_create'), path('api/recipes/<id>', views.RecipeRUD.as_view(), name='recipe_rud'), path('api/recipes/<id>/made/', views.MakeRecipeView.as_view(), name='recipe_make'), path('api/users/<id>/recipes/', views.UserRecipeListView.as_view(), name='user_recipes'), path('api/register/', RegisterView.as_view(), name='api_register'), path('api/login/', LoginView.as_view(), name='rest_login'), path('api/logout/', LogoutView.as_view(), name='rest_logout'), path('api/user/', UserDetailsView.as_view(), name='rest_user_details'), path('api/password/change/', PasswordChangeView.as_view(), name='rest_password_change'), path('api/password/reset/', include('django_rest_passwordreset.urls', namespace='password_reset')), url(r'^.*', TemplateView.as_view(template_name='ng/index.html'), name='home'), ]
# 4 endpoints for drf-yasg # 1. A JSON view of your API specification at /swagger.json # 2. A YAML view of your API specification at /swagger.yaml # 3. A swagger-ui view of your API specification at /swagger/ # 4. A ReDoc view of your API specification at /redoc/ # TODO: swagger integration with JWT based authentication # url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), # url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), url(r'^redoc/v1/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), # DO NOT INCLUDE WHOLE REST_AUTH ALL URLS. An error will happen. (1. ~ 3. belows, rest-auth issue?) # => django.core.exceptions.ImproperlyConfigured: Field name `username` is not valid for model `User`. url(r'^rest-auth/', include('rest_auth.urls')), url(r'^rest-auth/login/$', LoginView.as_view(), name='rest_login'), url(r'^rest-auth/logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), url(r'^rest-auth/login/google/', GoogleLogin.as_view(), name='google_login'), url(r'^rest-auth/login/kakao/', KakaoLogin.as_view(), name='kakao_login'), path('', include(router.urls)), path('admin/', admin.site.urls), path('study/', include('studies.urls')), path('tag/', include('tags.urls')), path('question/', include('questions.urls')), path('comment/', include('comments.urls')), path('indicator/', include('indicators.urls')), path('image/', include('images.urls')),
from api.game.views import GameViewSet, PlayerViewSet from django.conf.urls import include, url from django.contrib import admin from rest_auth.views import LoginView from rest_framework import routers API_VERSION = 1 router = routers.DefaultRouter() router.register(r'games', GameViewSet, base_name='api_games') router.register(r'players', PlayerViewSet, base_name='api_players') urlpatterns = [ url( 'v{0}/'.format(API_VERSION), include([ url(r'^admin/', admin.site.urls), url(r'^api/', include(router.urls)), url(r'^login/', LoginView.as_view()), ])), ]
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.conf.urls.static import static from django.conf import settings from insta.views import HomeTemplateView, TestAuthView, LogoutViewEx, PostListView, PostCreateView from rest_auth.views import LoginView urlpatterns = [ path('admin/', admin.site.urls), #path('', include('insta.urls')) path('', HomeTemplateView.as_view(), name='home', ), path('test_auth/', TestAuthView.as_view(), name='test_auth', ), path('rest-auth/logout/', LogoutViewEx.as_view(), name='rest_logout', ), path('rest-auth/login/', LoginView.as_view(), name='rest_login', ), path('post_list/',PostListView.as_view(), name='post_list'), path('new/',PostCreateView.as_view(), name='post_create'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, re_path from rest_auth.registration.views import VerifyEmailView from rest_auth.views import LoginView from apps.users.views import RegistrationView urlpatterns = [ path('signup/', RegistrationView.as_view(), name='account_signup'), path('sigin/', LoginView.as_view(), name="sigin"), re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$', VerifyEmailView.as_view(), name='account_confirm_email'), ]
ChangeEmailConfirmationViewSet, ) ### # Routers ### """ Main router """ router = routers.SimpleRouter() ### # URLs ### urlpatterns = [ url( r'^login/$', LoginView.as_view(), name='rest_login', ), url( r'^logout/$', LogoutView.as_view(), name='rest_logout', ), url( r'^user/$', UserDetailsView.as_view(), name='rest_user_details', ), url( r'^change-password/$', PasswordChangeView.as_view(),
from django.urls import path from users.views import CreateUserAPIView, RetrieveUsernameAndColorAPIView from rest_auth.views import LoginView from rest_auth.views import LogoutView app_name = 'users' urlpatterns = [ path("create/", CreateUserAPIView.as_view(), name="user-create"), path("login/", LoginView.as_view(), name="user-login"), path("logout/", LogoutView.as_view(), name="user-logout"), path("me/", RetrieveUsernameAndColorAPIView.as_view(), name='user-me') ]
from django.urls import path, include from cognitev_app.views import RegisterAPIView from . import views from django.views.generic import TemplateView from rest_auth.views import ( LoginView, PasswordResetView, PasswordResetConfirmView, PasswordChangeView, LogoutView ) from rest_auth.registration.views import RegisterView, VerifyEmailView urlpatterns = [ path('', include('rest_auth.urls')), path('registration/',RegisterAPIView.as_view(), name='account_signup'), path('registration/', include('rest_auth.registration.urls')), path('login/', LoginView.as_view(), name='account_login'), path('logout/', LogoutView.as_view(), name='rest_logout'), #path('password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), #path('password/reset/confirm/<str:uidb64>/<str:token>/', #PasswordResetConfirmView.as_view(), #name='rest_password_reset_confirm'), #path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'), path('profile/<int:pk>/', views.ProfileAPIView.as_view()), path('user/<str:username>/', views.UserDetailView.as_view()), ]
from rest_auth.views import (LoginView, LogoutView, UserDetailsView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView) from rest_framework.authtoken.views import ObtainAuthToken rest_auth_patterns = ( # re-written from rest_auth.urls because of cache validation # URLs that do not require a session or valid token url(r'^password/reset/$', cache_page(0)(PasswordResetView.as_view()), name='rest_password_reset'), url(r'^password/reset/confirm/$', cache_page(0)(PasswordResetConfirmView.as_view()), name='rest_password_reset_confirm'), url(r'^login/$', cache_page(0)(LoginView.as_view()), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. url(r'^logout/$', cache_page(0)(LogoutView.as_view()), name='rest_logout'), url(r'^user/$', cache_page(0)(UserDetailsView.as_view()), name='rest_user_details'), url(r'^password/change/$', cache_page(0)(PasswordChangeView.as_view()), name='rest_password_change'), ) apipatterns = ( url(r'^$', login_required(cache_page(60 * 60)(APIRoot.as_view())), name='root_listing'), # url(r'^explore/', include('rest_framework_swagger.urls',