Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The current path, api/v1/users, didn’t match any of these

I am experiencing this problem following a tutorial and I can’t identify the error in my "SignUpView.vue" page. Tried changing to re_path and did not work.

Not Found: /api/v1/users
[15/Oct/2023 22:30:42] "POST /api/v1/users HTTP/1.1" 404 7646

Code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

URLS.PY

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('djoser.urls')),
    path('api/v1/', include('djoser.urls.authtoken'))
]

ERROR images:

Error showing on signing up

Page not found (404)

SignUpView.vue:

if everything goes right. I’m supposed to get forward on localhost:8080/log-in

methods: {
        submitFrom(e) {
            const formData = {
                username: this.username,
                password: this.password
            }

            axios
                .post("/api/v1/users", formData)
                .then(response => {
                    console.log(response)

                    this.$router.push('log-in')
                })

Please help me to solve this problem. Thanks in Advance. (..)

>Solution :

The trailing slash is important, and it is advisable to always add one to the URL paths, so you make a POST request on:

.post("/api/v1/users/", formData)  // 🖘 trailing slash
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading