Hi I am currently developing a website with a react frontend and django backend. I need to store a gitlab access token for each user in my db so that it can be used to interact with the gitlab api (using python gitlab api https://python-gitlab.readthedocs.io/en/stable/), so that the user can create or modify a git repository using this access token.
I want to store the GitLab access token in a model with the users email so that when they for example want to create a repository the view will take the users input such as repository name etc and then use the access token to create the repository but I am wary about storing the access token as I know this could be a security risk.
This is for a personal project for self-education purposes so if I do make a mistake the repurcussions will be low as no actual users will be using this program just me.
I still want to do this the "right way" however and I am wondering, is there any way in django to create an encrypted field for the access token field in the model, that can then be obtained and decrypted when it needs to be used.