Hello, I want to add Vue.js to my project, but I don’t know about the connection between the two. I want to do;
When I open the localhost:8000/student/expert link, it will show the template I have prepared in Vue.js.
My project path is like this:
Serve in Vue.js frontend
from dataclasses import fields from rest_framework.serializers import ModelSerializer from .models import StudentExpert class StudentExpertSerializer(ModelSerializer): class Meta: model = StudentExpert fields = "__all__"
class StudentViewSet(ModelViewSet): template_name = "student/expert.html" queryset = StudentExpert.objects.all() serializer_class = StudentExpertSerializer
from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register('kea', StudentViewSet) app_name = "urls_student" urlpatterns = [ path('', include(router.urls)) ]
As a result of the preparation I made, I was able to serve my student/expert page in this way.
Then I created a page in Vue.js and successfully completed the crud operations.
What I want to do now is to serve the file I prepared in vue.js when logging in to the http://127.0.0.1:8000/student/kea/ link address.