"""nord_esg URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.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
from django.conf.urls.static import static
from django.conf.urls import handler404, handler500, handler403
from users import views as users_views
from django.conf import settings
from django.views.i18n import set_language
from django.contrib.auth import views as auth_views

#importing 
from django.conf.urls.i18n import i18n_patterns

urlpatterns = i18n_patterns(
    path('admin/', admin.site.urls),
    path('docs/',include("documents.urls")),
    path('org/',include("organisations.urls")),
    path('questions/',include("questions.urls")),
    path('',include("users.urls")),
    path('', include("stakeholders.urls")),
    path('reset/<uidb64>/<token>/',
         auth_views.PasswordResetConfirmView.as_view(template_name="users/password_set_confirm.html"),
         name='password_reset_confirm'),
    path('reset/done/',
         auth_views.PasswordResetCompleteView.as_view(template_name='users/password_set_complete.html'),
         name='password_reset_complete'),
    path('password-reset/', users_views.password_reset, name="password-reset"),
    path('password-reset/done/',
          auth_views.PasswordResetDoneView.as_view(
              template_name='users/password_reset_done.html'),
          name='password-reset-done'),
    prefix_default_language=True

)


if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


handler404 = users_views.error_404
handler500 = users_views.error_500
handler403 = users_views.error_403

admin.site.site_header  =  "Nord ESG Super User"  
admin.site.site_title  =  "Nord ESG"
admin.site.index_title  =  "Nord ESG"
