Tuesday, July 31, 2018

Re: Change the default route of a view

For the view that I wrote, you won't need an id in the request or on the url at all. It uses the currently logged in user for all of the requests.

You will need to pass some kind of token in the request - so that you know which user is logged in.

But the url could be something like this:

urlpatterns = [
  path('/profile', views.UserProfileChangeAPIView.as_view(), name='profile'),
]

That way the /profile url would be used for the view.

Regards,

Andréas

2018-07-30 17:35 GMT+02:00 Jason <jjohns98684@gmail.com>:
its not a url, its a http verb.  rely on those for API requests.  

and it would be a user ID for that request.  if you're using oauth tokens, that should be handled in your view authenticator, not the view itself

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c36b4a7e-3c53-4805-9e45-35e22eb20357%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCdcHGMe3inZKtM7A%2BzNiYjG%3DdQYVF7DvxF5rx0Mqfj-Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment