Esempio n. 1
0
# from apps.common.apis import RegisterAPI, LoginAPI
from apps.myblog.apis import GenericAPIView, GenericAPIViewDetail, GenericAPIViewCreatePost
from django.contrib.auth import views as auth_views
from knox import views as knox_views
from rest_framework.authtoken import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name='home'),
    path('profile-update/', ProfileUpdateView.as_view(),
         name='profile-update'),
    path('profile/', ProfileView.as_view(), name='profile'),
    path('profile/<str:username>',
         ProfileViewFriend.as_view(),
         name='profile-friend'),
    path('register/', SignUpView.as_view(), name='register'),
    path('login/',
         auth_views.LoginView.as_view(template_name='common/login.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(next_page='home'),
         name='logout'),
    path('change-password/',
         auth_views.PasswordChangeView.as_view(
             template_name='common/change-password.html', success_url='/'),
         name='change_password'),
    path('dashboard/', DashboardView.as_view(), name='dashboard'),
    path('post_new/', PostCreateView.as_view(), name='post_new'),
    path('post/<int:pk>/update/', PostUpdateView.as_view(),
         name='post-update'),
    path('blogs/', PostListView.as_view(), name='blogs'),
Esempio n. 2
0
from django.urls import path, include

from apps.common.views import HomeView, SignUpView, DashboardView, ProfileUpdateView, ProfileView

from django.contrib.auth import views as auth_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name='home'),
    path('dashboard/', DashboardView.as_view(), name='dashboard'),
    path('profile-update/', ProfileUpdateView.as_view(),
         name='profile-update'),
    path('profile/', ProfileView.as_view(), name='profile'),

    # Authentication
    path('register/', SignUpView.as_view(), name="register"),
    path('login/',
         auth_views.LoginView.as_view(template_name='common/login.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(next_page='home'),
         name='logout'),
    path('change-password/',
         auth_views.PasswordChangeView.as_view(
             template_name='common/change-password.html', success_url='/'),
         name='change-password'),

    # Forget Password
    path(
        'password-reset/',
        auth_views.PasswordResetView.as_view(