Sometimes, you will need to get the current authenticated user in models, or other parts of your app.

To achieve this, you must create this middleware in your app( and add it to MIDDLEWARE_CLASSES in project settings:


Use Example:


Leave a Reply

Your email address will not be published. Required fields are marked *