<NME> urls.py
<BEF> from functools import reduce

from ckeditor_uploader import views as cku_views

from django.conf import settings
from django.conf.urls import include, url
from django.views.i18n import JavaScriptCatalog

from django.contrib.auth.decorators import login_required

from ckeditor_uploader import views as cku_views
from rest_framework.documentation import include_docs_urls

from modoboa.admin.views.user import forward
from modoboa.core.extensions import exts_pool
from modoboa.core import signals as core_signals

API_TITLE = 'Modoboa API'

    path('ckeditor/upload/', login_required(cku_views.upload),
         name="ckeditor_upload"),
    path('ckeditor/browse/', login_required(cku_views.browse),
         name="ckeditor_browse"),

    path('', include("modoboa.core.urls")),
    path('admin/', include("modoboa.admin.urls")),
    path('dnstools/', include("modoboa.dnstools.urls")),
    url('admin/', include('modoboa.admin.urls', namespace="admin")),
    url('relaydomains/',
        include('modoboa.relaydomains.urls', namespace="relaydomains")),
]

exts_pool.load_all()
         auth_views.PasswordResetConfirmView.as_view(),
         name="password_reset_confirm"),
    path('reset/done/', auth_views.PasswordResetCompleteView.as_view(),
         name="password_reset_complete"),
]

exts_pool.load_all()
urlpatterns += exts_pool.get_urls()

extra_routes = core_signals.extra_uprefs_routes.send(sender="urls")
if extra_routes:
    extra_routes = reduce(
        lambda a, b: a + b, [route[1] for route in extra_routes])
    urlpatterns += extra_routes

# API urls
urlpatterns += [
    # FIXME: legacy, to remove ASAP
    path('docs/openapi.json',
         SpectacularJSONAPIView.as_view(api_version="v1"), name='schema-v1-legacy'),

    path('api/schema-v1/',
         SpectacularJSONAPIView.as_view(api_version="v1"), name='schema-v1'),
    path('api/schema-v1/swagger/',
         SpectacularSwaggerView.as_view(url_name='schema-v1'),
         name='docs-index-v1'),
    path('api/schema-v1/redoc/',
         SpectacularRedocView.as_view(url_name='schema-v1')),

    path('api/schema-v2/',
         SpectacularJSONAPIView.as_view(api_version="v2"), name='schema-v2'),
    path('api/schema-v2/swagger/',
         SpectacularSwaggerView.as_view(url_name='schema-v2'),
         name='docs-index-v2'),
    path('api/schema-v2/redoc/',
         SpectacularRedocView.as_view(url_name='schema-v2')),
    path('api/v1/', include("modoboa.urls_api_v1", namespace="v1")),
    path('api/v2/', include("modoboa.urls_api_v2", namespace="v2")),
]

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.conf.urls.static import static
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(
        settings.MEDIA_URL, document_root=settings.MEDIA_ROOT
    )

<MSG> Added password reset service.

see #1151

<DFF> @@ -6,14 +6,16 @@ from django.conf import settings
 from django.conf.urls import include, url
 from django.views.i18n import JavaScriptCatalog
 
+from django.contrib.auth import views as auth_views
 from django.contrib.auth.decorators import login_required
 
 from ckeditor_uploader import views as cku_views
 from rest_framework.documentation import include_docs_urls
 
 from modoboa.admin.views.user import forward
-from modoboa.core.extensions import exts_pool
 from modoboa.core import signals as core_signals
+from modoboa.core import views as core_views
+from modoboa.core.extensions import exts_pool
 
 API_TITLE = 'Modoboa API'
 
@@ -28,6 +30,16 @@ urlpatterns = [
     url('admin/', include('modoboa.admin.urls', namespace="admin")),
     url('relaydomains/',
         include('modoboa.relaydomains.urls', namespace="relaydomains")),
+    # No namespace
+    url(r'^accounts/password_reset/$', core_views.password_reset,
+        name="password_reset"),
+    url(r'^accounts/password_reset/done/$', auth_views.password_reset_done,
+        name="password_reset_done"),
+    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',  # noqa
+        auth_views.password_reset_confirm, name="password_reset_confirm"),
+    url(r'^reset/done/$', auth_views.password_reset_complete,
+        name="password_reset_complete"),
+
 ]
 
 exts_pool.load_all()

Added password reset service.