tmpbook / django-with-vuejs

Fast and clear in DevOps.
MIT License
423 stars 108 forks source link

how to handle django login page from vuejs ? #13

Closed gagansuntle closed 6 years ago

gagansuntle commented 6 years ago

hi, I followed your project structure. I would like to know how we can use allauth templates from vuejs components ?

tmpbook commented 6 years ago

if you want use the django auth, you can try the DRF, because the vuejs usually use the json to transport data

Content-Type:application/json

django auth templates and the vuejs is completely two type of how the fontend build, you can use them both if you like.(you can collectstatics to the dist dir, then handle them via nginx)

tmpbook commented 6 years ago

@gagansuntle

from django.conf.urls import url
from rest_framework.authtoken import views as drf_views

urlpatterns = [
    url(r'^auth$', drf_views.obtain_auth_token, name='auth'),
]