<NME> urls.py
<BEF> from django.conf.urls import patterns, include, url
from django.conf import settings
from modoboa.extensions import *
from modoboa.lib import parameters


urlpatterns = patterns('',
    (r'^$', 'modoboa.lib.webutils.topredirection'),
    (r'^accounts/login/$', 'modoboa.auth.views.dologin'),
    (r'^accounts/logout/$', 'modoboa.auth.views.dologout'),
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
     {'packages': ('modoboa', ), }),
    *exts_pool.load_all()
)

    path('user/forward/', user_views.forward, name="user_forward"),

    path('accounts/password_reset/', core_views.PasswordResetView.as_view(),
         name="password_reset"),
    path('accounts/password_reset/done/',
         auth_views.PasswordResetDoneView.as_view(),
         name="password_reset_done"),
    path('reset/confirm_code/',
         core_views.VerifySMSCodeView.as_view(),
         name="password_reset_confirm_code"),
    path('reset/resend_code/',
         core_views.ResendSMSCodeView.as_view(),
         name="password_reset_resend_code"),
    path('reset/<uidb64>/<token>/',
         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> wip: big refactoring

Moving files.

<DFF> @@ -1,15 +1,31 @@
 from django.conf.urls import patterns, include, url
 from django.conf import settings
-from modoboa.extensions import *
+from modoboa.core.extensions import exts_pool
 from modoboa.lib import parameters
+from modoboa.core import load_settings
 
+load_settings()
 
 urlpatterns = patterns('',
     (r'^$', 'modoboa.lib.webutils.topredirection'),
-    (r'^accounts/login/$', 'modoboa.auth.views.dologin'),
-    (r'^accounts/logout/$', 'modoboa.auth.views.dologout'),
     (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
      {'packages': ('modoboa', ), }),
+
+    (r'^accounts/login/$', 'modoboa.core.views.auth.dologin'),
+    (r'^accounts/logout/$', 'modoboa.core.views.auth.dologout'),
+
+    (r'^admin/$', 'modoboa.core.views.admin.viewsettings'),
+    (r'^admin/parameters/$', 'modoboa.core.views.admin.viewparameters'),
+    (r'^admin/parameters/save/$', 'modoboa.core.views.admin.saveparameters'),
+    (r'^admin/extensions/$', 'modoboa.core.views.admin.viewextensions'),
+    (r'^admin/extensions/save/$', 'modoboa.core.views.admin.saveextensions'),
+    (r'^admin/info/$', 'modoboa.core.views.admin.information'),
+    (r'^admin/logs/$', 'modoboa.core.views.admin.logs'),
+
+    (r'^user/$', 'modoboa.core.views.user.index'),
+    (r'^user/preferences/$', 'modoboa.core.views.user.preferences'),
+    (r'^user/profile/$', 'modoboa.core.views.user.profile'),
+
     *exts_pool.load_all()
 )
 

wip: big refactoring