Social Auth - Google Login - Part 3
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'Client ID'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'Client Secret'


AUTHENTICATION_BACKENDS = (
    ...
    'social_core.backends.google.GoogleOAuth2',
)

 

<style>

  #gg_button{
    width:100%;
    color:#606060;
    background-color:white;
    margin-bottom:10px;
    border: 1px solid #c8ccd0;
    border-radius: 5px !important;
    -webkit-box-shadow: 1px 1px 9px 0px rgba(190, 190, 190, 0.5);
    -moz-box-shadow:    1px 1px 9px 0px rgba(190, 190, 190, 0.5);
    box-shadow:         1px 1px 9px 0px rgba(190, 190, 190, 0.5);
  }
  
  #gg_button:hover{
    background-color:  #f2f3f5;
  }

</style>


<a id="gg_button" class="btn btn-primary" href="{% url 'social:begin' 'google-oauth2' %}">Login with Google</a>

 


Python 3.12
Django==4.2


12 July 2024 | Last Updated: 22 Nov. 2025 | jaimedcsilva

Related
  • Social Auth - Setting up - Part 1
  • Social Auth - Google Cloud Platform - Part 2
  • Social Auth - Google Login - Part 3
  • Social Auth - Facebook Developers - Part 4
  • Social Auth - Facebook Login - Part 5
  • Social Auth - SOCIAL_AUTH_PIPELINE - Part 6

  • Buy Me a Coffee