Can we create a self-defined token in the Token Auth in Django?
Currently, we are creating a super-user and generating a token for that super-user. But there are several environments and we want to keep the token same for all environments. Hence, a self-defined token is needed.
For example, if we create token using Token Auth
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
],
}
we first create a superuser, then we create a token using django-admin.
Authorization:Token 8b000baba908hh7cf0618d492896e7b4bd6c9ce3
Here, I want to define my own token which will be saved in the same table.