How to find user Information by token

2020-07-03 Thread sebastian wrzalek
I dont know about built in token authenitication but you can easily do it with 
simpleJWT, decode token on client side to get user id, then you can create 
endpoint for retreiving user details.

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/449edea2-f05e-4a33-9297-b6fac54114e8o%40googlegroups.com.


How to find user Information by token

2020-07-03 Thread Prince Dewangan
hi there,
 i am new Django and i have managed to build a small Api using DRF. I
havemy angular client end posting user auth details and DRF returns
a  token after login. so question is if posible to find user by
token ? if  possible how i can get user information like {
   id, username, firstname, etc..}

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CADX90mAOrG%2BXwFs6XWTL2c2aMhLLg03sKN%3D8KwDQyv4hSYF_jw%40mail.gmail.com.


Re: Information

2019-01-12 Thread Wanderley S
Hi. By using Django itself will be completely possible to achieve your
needs, as explained already. One scenario I would suggest DRF, is if you
want to decouple frontend from backend, by using Vue.js, React.js (or any
other javascript framework). In this exposed situation DRF is the perfect
choice.

Em 12/01/2019 19:56, "Gonzalo Amadio"  escreveu:

I think you are a bit confused of the purpose of each package.

The ones you have named, each has a different purpose.

As said, you can do this with only Django, and plain Js..
Rest framework is more API / web services oriented.

What you are trying to do as I understand it's a "normal" website..

As per user and admin issue, django comes with this functionality built-in..
The design , will be in HTML/css and all the Django templates , also
built-in functionality

El mié., 9 ene. 2019 0:19,  escribió:

> Hi :)
>
> I will tell you my project, it will be easier to understand :)
>
> I have to create a dashboard as on the image for "users" as the "admin",
> of course it will have more functionality.
>
> The "users" by logging will have a list (links) in their dashboard with
> different themes that will cover math, logic, Portuguese, French and
> English exercises, a link on their account and another link to disconnect .
> They will also have a "scoring" and a "graph" to show their skills.
>
> The "admin", it will be able to see all the "scoring" of all the "users",
> or to select one to see where it has in the form of "graphical".
> It will also be able to reset the passwords.
>
> Also have something secure during authentication.
>
>
>- I would like to know if django-rest-framework is suitable for my
>project ?
>- You say that it is not necessary to take a package, you mean to do
>it by hand (html, css, js) ?
>- If django-rest-framework does not match me, which package do you
>advise me for the authentication ?
>And level dashboard, I find that (django-controlcenter
> and
>django-responsive-dashboard
>), what
>do you think ?
>
> I know that's a lot of questions I apologize in advance but it would help
> me a lot to know which path best fits what I want.
>
> Thanks :)
>
> Le mardi 8 janvier 2019 12:04:37 UTC+1, Jani Tiainen a écrit :
>>
>> Hi.
>>
>> Before jumping into more advanced stuff, what problem you do have that
>> DRF would resolve for you?
>>
>> Because building a dashboard like that doesn't require DRF, you can do it
>> very well with Django itself without any additional packages.
>>
>> Also what do you mean with "authentication in a secure way"? What would
>> be insecure?
>>
>> On Tue, Jan 8, 2019 at 12:08 PM  wrote:
>>
>>> Hello, I started in Django and I would like to know if Django REST
>>> framework could meet my needs:
>>>
>>>
>>>- Manages authentication in a secure way (admin & user) ?
>>>- Have a vertical dashboard as on this image (user & admin, of
>>>course the admin will have more functionality) ?
>>>
>>> [image: 2019-01-07_16h17_25-ConvertImage.jpg]
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Or better to go on another package of its kind django-control
>>>  ?
>>>
>>> Thank you, you would help me a lot by answering it is question. :)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-framework+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Jani Tiainen
>>
>> - Well planned is half done, and a half done has been sufficient before...
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Information

2019-01-12 Thread Gonzalo Amadio
I think you are a bit confused of the purpose of each package.

The ones you have named, each has a different purpose.

As said, you can do this with only Django, and plain Js..
Rest framework is more API / web services oriented.

What you are trying to do as I understand it's a "normal" website..

As per user and admin issue, django comes with this functionality built-in..
The design , will be in HTML/css and all the Django templates , also
built-in functionality

El mié., 9 ene. 2019 0:19,  escribió:

> Hi :)
>
> I will tell you my project, it will be easier to understand :)
>
> I have to create a dashboard as on the image for "users" as the "admin",
> of course it will have more functionality.
>
> The "users" by logging will have a list (links) in their dashboard with
> different themes that will cover math, logic, Portuguese, French and
> English exercises, a link on their account and another link to disconnect .
> They will also have a "scoring" and a "graph" to show their skills.
>
> The "admin", it will be able to see all the "scoring" of all the "users",
> or to select one to see where it has in the form of "graphical".
> It will also be able to reset the passwords.
>
> Also have something secure during authentication.
>
>
>- I would like to know if django-rest-framework is suitable for my
>project ?
>- You say that it is not necessary to take a package, you mean to do
>it by hand (html, css, js) ?
>- If django-rest-framework does not match me, which package do you
>advise me for the authentication ?
>And level dashboard, I find that (django-controlcenter
> and
>django-responsive-dashboard
>), what
>do you think ?
>
> I know that's a lot of questions I apologize in advance but it would help
> me a lot to know which path best fits what I want.
>
> Thanks :)
>
> Le mardi 8 janvier 2019 12:04:37 UTC+1, Jani Tiainen a écrit :
>>
>> Hi.
>>
>> Before jumping into more advanced stuff, what problem you do have that
>> DRF would resolve for you?
>>
>> Because building a dashboard like that doesn't require DRF, you can do it
>> very well with Django itself without any additional packages.
>>
>> Also what do you mean with "authentication in a secure way"? What would
>> be insecure?
>>
>> On Tue, Jan 8, 2019 at 12:08 PM  wrote:
>>
>>> Hello, I started in Django and I would like to know if Django REST
>>> framework could meet my needs:
>>>
>>>
>>>- Manages authentication in a secure way (admin & user) ?
>>>- Have a vertical dashboard as on this image (user & admin, of
>>>course the admin will have more functionality) ?
>>>
>>> [image: 2019-01-07_16h17_25-ConvertImage.jpg]
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Or better to go on another package of its kind django-control
>>>  ?
>>>
>>> Thank you, you would help me a lot by answering it is question. :)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-framework+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Jani Tiainen
>>
>> - Well planned is half done, and a half done has been sufficient before...
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Information

2019-01-08 Thread anthonymorreau
Hi :)

I will tell you my project, it will be easier to understand :)

I have to create a dashboard as on the image for "users" as the "admin", of 
course it will have more functionality.

The "users" by logging will have a list (links) in their dashboard with 
different themes that will cover math, logic, Portuguese, French and 
English exercises, a link on their account and another link to disconnect .
They will also have a "scoring" and a "graph" to show their skills.

The "admin", it will be able to see all the "scoring" of all the "users", 
or to select one to see where it has in the form of "graphical".
It will also be able to reset the passwords.

Also have something secure during authentication.


   - I would like to know if django-rest-framework is suitable for my 
   project ?
   - You say that it is not necessary to take a package, you mean to do it 
   by hand (html, css, js) ?
   - If django-rest-framework does not match me, which package do you 
   advise me for the authentication ? 
   And level dashboard, I find that (django-controlcenter 
    and 
   django-responsive-dashboard 
   ), what 
   do you think ?
   
I know that's a lot of questions I apologize in advance but it would help 
me a lot to know which path best fits what I want.

Thanks :)

Le mardi 8 janvier 2019 12:04:37 UTC+1, Jani Tiainen a écrit :
>
> Hi.
>
> Before jumping into more advanced stuff, what problem you do have that DRF 
> would resolve for you?
>
> Because building a dashboard like that doesn't require DRF, you can do it 
> very well with Django itself without any additional packages.
>
> Also what do you mean with "authentication in a secure way"? What would be 
> insecure?
>
> On Tue, Jan 8, 2019 at 12:08 PM > 
> wrote:
>
>> Hello, I started in Django and I would like to know if Django REST 
>> framework could meet my needs:
>>
>>
>>- Manages authentication in a secure way (admin & user) ? 
>>- Have a vertical dashboard as on this image (user & admin, of course 
>>the admin will have more functionality) ? 
>>
>> [image: 2019-01-07_16h17_25-ConvertImage.jpg]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Or better to go on another package of its kind django-control 
>>  ?
>>
>> Thank you, you would help me a lot by answering it is question. :)
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-framework+unsubscr...@googlegroups.com 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Jani Tiainen
>
> - Well planned is half done, and a half done has been sufficient before...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Information

2019-01-08 Thread Anthony Morreau
Hi :)

I will tell you my project, it will be easier to understand :)

I have to create a dashboard as on the image for "users" as the "admin", of
course it will have more functionality.

The "users" by logging will have a list (links) in their dashboard with
different themes that will cover math, logic, Portuguese, French and
English exercises, a link on their account and another link to disconnect .
They will also have a "scoring" and a "graph" to show their skills.

The "admin", it will be able to see all the "scoring" of all the "users",
or to select one to see where it has in the form of "graphical".
It will also be able to reset the passwords.

Also have something secure during authentication.


   - I would like to know if django-rest-framework is suitable for my
   project ?
   - You say that it is not necessary to take a package, you mean to do it
   by hand (html, css, js) ?
   - If django-rest-framework does not match me, which package do you
   advise me for the authentication ?
   And level dashboard, I find that (django-controlcenter
    and
   django-responsive-dashboard
   ), what
   do you think ?

I know that's a lot of questions I apologize in advance but it would help
me a lot to know which path best fits what I want.

Thanks :)

Le mar. 8 janv. 2019 à 12:04, Jani Tiainen  a écrit :

> Hi.
>
> Before jumping into more advanced stuff, what problem you do have that DRF
> would resolve for you?
>
> Because building a dashboard like that doesn't require DRF, you can do it
> very well with Django itself without any additional packages.
>
> Also what do you mean with "authentication in a secure way"? What would be
> insecure?
>
> On Tue, Jan 8, 2019 at 12:08 PM  wrote:
>
>> Hello, I started in Django and I would like to know if Django REST
>> framework could meet my needs:
>>
>>
>>- Manages authentication in a secure way (admin & user) ?
>>- Have a vertical dashboard as on this image (user & admin, of course
>>the admin will have more functionality) ?
>>
>> [image: 2019-01-07_16h17_25-ConvertImage.jpg]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Or better to go on another package of its kind django-control
>>  ?
>>
>> Thank you, you would help me a lot by answering it is question. :)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-rest-framework+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Jani Tiainen
>
> - Well planned is half done, and a half done has been sufficient before...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Information

2019-01-08 Thread Jani Tiainen
Hi.

Before jumping into more advanced stuff, what problem you do have that DRF
would resolve for you?

Because building a dashboard like that doesn't require DRF, you can do it
very well with Django itself without any additional packages.

Also what do you mean with "authentication in a secure way"? What would be
insecure?

On Tue, Jan 8, 2019 at 12:08 PM  wrote:

> Hello, I started in Django and I would like to know if Django REST
> framework could meet my needs:
>
>
>- Manages authentication in a secure way (admin & user) ?
>- Have a vertical dashboard as on this image (user & admin, of course
>the admin will have more functionality) ?
>
> [image: 2019-01-07_16h17_25-ConvertImage.jpg]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Or better to go on another package of its kind django-control
>  ?
>
> Thank you, you would help me a lot by answering it is question. :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Information

2019-01-08 Thread anthonymorreau
Hello, I started in Django and I would like to know if Django REST 
framework could meet my needs:


   - Manages authentication in a secure way (admin & user) ? 
   - Have a vertical dashboard as on this image (user & admin, of course 
   the admin will have more functionality) ? 
   
[image: 2019-01-07_16h17_25-ConvertImage.jpg] 





















Or better to go on another package of its kind django-control 
 ?

Thank you, you would help me a lot by answering it is question. :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Redefining ObtainAuthToken to populate response payload with extra information

2017-12-19 Thread Santiago Fraire Willemoës
Hey folks, as the title says, my team would like to return the payload 
after a user authenticates with extra information (mostly related to the 
user). 
As a solution to this, we would like to redefine ObtainAuthToken 
<https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/views.py#L15>
 as suggested in the docs 
<http://www.django-rest-framework.org/api-guide/authentication/#generating-tokens>
. 
The problem is that the user object after calling the super method is not 
present, so a new query for the user must be done. Another alternative 
would be to copy the whole post function and change it, but I think it 
would be better to call super, and make minor modifications.
So my question is, is there a better way to do this? Would be possible to 
update DRF to add the user to the self in the view (initialized as None)?

Thanks a lot!


-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.