DEV Community

aliplutus
aliplutus

Posted on

how to login/signup using django-allauth without leaving the page.

how to make a login popup like this
when you go to localhost:8000/accounts/login and lick google django-allauth will redirect you to the google login/singup page. But, I want to get all the user accounts inside my page in which I can create the list of the google account so user can click them and login or singup without leaving the page.
Note: I know how to make a popup window where it open the google login/singup page but this is not what I want. I want to get each account separately not an uncontainable google page

Top comments (2)

Collapse
 
aliplutus profile image
aliplutus

I found some solution
in templates/index.html you can manipulate the values and their structure or send them to reactjs like this example

//index.html
 <div id='root' data-backendData={% include "socialaccount/snippets/provider_list.html" with process="login" %} />
Enter fullscreen mode Exit fullscreen mode
//index.html
<h1>
      {% include "socialaccount/snippets/provider_list.html" with process="login" %}
</h1>


{% load i18n %}




<form method="post" action="{% url 'account_logout' %}">
  {% csrf_token %}
  {% if redirect_field_value %}
  <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
  {% endif %}
  <button type="submit">{% trans 'Sign Out' %}</button>
</form>
Enter fullscreen mode Exit fullscreen mode
Collapse
 
cabudies profile image
Gurjas Singh

I'm trying to do it in navbar using include functionality.. can you share something about that.