shaare.it

ImproperlyConfigured: LOGIN_URL not set

7 Dec 2025

1 min read

ImproperlyConfigured: LOGIN_URL not set

$ python manage.py runserver
...
ImproperlyConfigured: LOGIN_URL setting is not configured.

Why this happens

@login_required needs a login URL to redirect unauthenticated users.

Fix

Set LOGIN_URL in settings.

Wrong code

# missing LOGIN_URL

Fixed code

LOGIN_URL = '/accounts/login/'