'Django allauth Facebook and Google login

For normal signin/signup i'm using django's default singin/signup, but in facebook and google login i'm using django allauth, and to implement django allauth i have to add all its urls by adding:

    path('accounts/', include('allauth.urls')),

But i don't need all the allauth urls, i only need the ones that are related to facebook and google social login.
So how do i add only the ones that are needed for facebook and google login to run
i tried this:

  path("accounts/", include("allauth.socialaccount.providers.google.urls")),
  path("accounts/", include("allauth.socialaccount.providers.facebook.urls")),

With these two lines Google login worked normally but facebook login worked at first steps but the last step where i'm redirected to /accounts/facebook/login/callback/?code=xxxxx... it returns error 500

I'm pretty sure the login was implemented correctly and the problem is in adding the needed urls because everything works normally when using include('allauth.urls')



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source