Rest framework oauth2 login with email or username

Hello dear django comunity,

i’m creating an application with DRF and Oauth2 and the problem that i facing is i want to get an Oauth2 token with either email or username the curl of this request should be similar to this:

curl -X POST -d “grant_type=password&email_or_username=email_or_username&password=password” -u"<client_id>:<client_secret>"