Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class DefaultService(object):
  2. def create_super_user(self):
  3. user = User.objects.create_user(
  4. username='suadmin',
  5. email='suadmin@theqeasy.com',
  6. password='admin123',
  7. is_staff=True
  8. )
  9.  
  10. user.is_superuser = True
  11.  
  12. user.save()
  13.  
  14. return user
  15.  
  16. def create_oath2_application(self, user_id):
  17. application = Application(
  18. name="DjangoTest",
  19. client_id="PlaceYourClinetID",
  20. client_secret="PlaceYourClinetSecret",
  21. client_type="confidential",
  22. authorization_grant_type="password",
  23. user_id=user_id
  24. )
  25.  
  26. application.save()
  27.  
  28. return application
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement