This makes me remember how annoying Django and its third party packages sometimes get.
Say I want to spin up a simple project that:
- has a few new fields for the User model, thus requiring to create a custom user model
- has registration APIs (signup) requiring the new fields in User model
- has authentication APIs (login, logout) but using a new field in the User model
- has user authentication management APIs (change password, forgot password, etc)
Enter DRF, and django-rest-auth.
One would think that they will make your life easy. But hell no.
Having a custom model and requiring their integration in the APIs provided thereby by rest-auth is a huge pain in the ass.
First of all, allauth some how comes into play.
Then, you have to write a funky new custom account adapter that replaces the one allauth uses by default
Then, define custom serializers and views and urls for registration, login, logout, etc.
And run into many other problems revolving around setting some X_Y_Z settings local to the third party package.
It's truly mind boggling that this hasn't been solved yet.
Maybe I'll just write something that does all that so that I don't have to cry in pain when using rest-auth and drf with Django for basic project already setup with custom user registration, and authentication and authentication management.