After researching on ways to extend user table of auth app in django , I have decided to write my own auth app.
These are the things which I need to do for replacing the contrib.auth
app:
- Create an
AuthenticationMiddleware
class and add anMyAuth.models.User
object in every request instead ofdjango.auth.models.User
and point to it in settings file. - Create a custom
AuthenticationBackend
. - Create
AuthenticationContextProcessor
s and similarly point to them in settings file.
Questions:
- Do I need to do any editing in any other app or session middleware class?
- The basic reason of writing my own auth app is not having enough fields in the user table
and I don't like the idea of
user_profile
. I have noticed that we add user object to every request so that I can use that in sessions. But If I add more fields in user table then user object will get bigger and if added to every request will only increase the load. Am I right? Will increasing the size of the user object pose any load problems? Or will the effect be negligible?