"""URLs module"""
from django.urls import path
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from . import views


app_name = "helusers"

urlpatterns = [
    path("logout/", views.LogoutView.as_view(), name="auth_logout"),
    path(
        "logout/complete/",
        views.LogoutCompleteView.as_view(),
        name="auth_logout_complete",
    ),
    path("login/", views.LoginView.as_view(), name="auth_login"),
]

if not settings.LOGOUT_REDIRECT_URL:
    raise ImproperlyConfigured(
        "You must configure LOGOUT_REDIRECT_URL to use helusers views."
    )

"""URLs module"""
from django.urls import path
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from . import views


app_name = "helusers"

urlpatterns = []

if not settings.LOGOUT_REDIRECT_URL:
    raise ImproperlyConfigured(
        "You must configure LOGOUT_REDIRECT_URL to use helusers views."
    )

urlpatterns.extend(
    [
        path("logout/", views.LogoutView.as_view(), name="auth_logout"),
        path(
            "logout/complete/",
            views.LogoutCompleteView.as_view(),
            name="auth_logout_complete",
        ),
        path("login/", views.LoginView.as_view(), name="auth_login"),
    ]
)

Check configuration before specifying urlpatterns
Check configuration before specifying urlpatterns

If the configuration is incorrect, it doesn't make sense to specify the
URL patterns in that case.
