2

so i have a project that i created with vuejs and django, for authentication i did it with session authentification. so when it connects it launches vue js project but i wanted to know can i do it when it won't be authentify like do i create a new vuejs project or i can use the old one. or tell me if you have a other proposition . ps: i know that there are Jwt Authentification]

#python url to lunch vuejs 
re_path(r"^(?!media/).*$", IndexTemplateView.as_view(), name="entry-point"),

the view :

class IndexTemplateView(LoginRequiredMixin, TemplateView):

    def get_template_names(self):
        if not settings.DEBUG:
            template_name = "index.html"
        else:
            template_name = "index-dev.html"
        return template_name



1 Answer 1

1

Don't use SessionAuthentication

From django-rest-framework's official docs SessionAuthentication is appropriate for AJAX clients that are running in the same session context as your website.

Use TokenAuthentication

Consider using TokenAuthentication which is appropriate for client-server setups, your vue.js app being the client

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.