Skip to content

Instantly share code, notes, and snippets.

@WillianFuks
Created June 30, 2021 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillianFuks/efd3f971573067fe01d024800fdc1de9 to your computer and use it in GitHub Desktop.
Save WillianFuks/efd3f971573067fe01d024800fdc1de9 to your computer and use it in GitHub Desktop.
from django.apps import AppConfig
class TestappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'testapp'
def ready(self):
import djwto.tokens as tokens
def new_process_user(user):
return {
user.USERNAME_FIELD: user.get_username(),
'email': user.email,
'id': user.pk,
'perms': tokens.process_perms(user)
}
tokens.process_user = new_process_user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment