DEV Community

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

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.