Django Auth0 is showing error that callback URL mismatch

Hi there,

I have a Django app that is working fine. I wanted to integrate Auth0’s OAuth Authentication to my app. I followed their official tutorial, but when I go to my Login Url, I get the error at Auth0 page that says:

Callback URL mismatch

Below is the screenshot of error:

Below is my django project’s main

urlpatterns = [
    path("admin/",, name="admin"),
    path("", login, name="home_x"),
    path("accounts/", include("apps.accounts.urls")),  # URLs of Login/Registration System

Below is of my django app named accounts:

urlpatterns = [
    path("login", views.login, name="login"),
    path("logout", views.logout, name="logout"),
    path("callback", views.callback, name="callback"),
        "switch-workspace/", SwitchWorkspace.as_view(), name="switch_workspace"

Below is my

def login(request):
    return oauth.auth0.authorize_redirect(
        request, request.build_absolute_uri(reverse("callback"))

def callback(request):
    token = oauth.auth0.authorize_access_token(request)
    request.session["user"] = token
    return redirect(request.build_absolute_uri(reverse("switch_workspace")))

def logout(request):

    return redirect(
        + urlencode(
                "returnTo": request.build_absolute_uri(reverse("login")),
                "client_id": settings.AUTH0_CLIENT_ID,

Below is my


and finally below are my settings in Auth0 Account:

Allowed Callbacks URLs:, http://localhost:8000/accounts/switch-workspace/, 

this is showing in the image below as well:

Anyone knows that what’s wrong? Because I don’t think I did anything wrong following the official tutorial here

I fixed this by adding the following URL to the Allowed Callback URLs option in the Auth0 Settings Webpage: