urls.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. from django.urls import path, include
  2. from django.contrib.auth import views as auth_views
  3. from website.settings import APPLICATION_NAME
  4. #from . import views
  5. app_name = 'core'
  6. urlpatterns = [
  7. #path('', views.index, name='index'),
  8. #url(r'^login/$', auth_views.LoginView.as_view(extra_context= { 'all_user': User.objects.all() },redirect_authenticated_user=True),name='login')
  9. path(
  10. 'login/',
  11. auth_views.LoginView.as_view(
  12. template_name='core/login.html',
  13. extra_context = {
  14. 'title': 'Log in',
  15. 'icon': 'sign in alternate',
  16. 'description': 'Authenticate with ' + APPLICATION_NAME,
  17. 'keywords': 'authenticate, login, logon, signin, signon, log in, log on, sign in, sign on',
  18. },
  19. ),
  20. name='login',
  21. ),
  22. path(
  23. 'logout/',
  24. auth_views.LogoutView.as_view(
  25. # template_name='core/logout.html',
  26. # extra_context = {
  27. # 'title': 'Logout',
  28. # 'icon': 'sign out alternate',
  29. # 'description': 'End authenticated session with ' + APPLICATION_NAME,
  30. # 'keywords': 'authenticate, logout, logoff, signout, signoff, log out, log off, sign out, sign off',
  31. # },
  32. ),
  33. name='logout',
  34. ),
  35. ]