code: def admin(module):
      
      # add module into admin site
      app = os.getcwd().split('/')[-1]
      if app != 'app':
          logger.warning('''\033[31m{Warning}\033[0m
  ==> your current path is \033[32m%s\033[0m\n
  ==> please add your sql module under app folder!''' % os.getcwd())
          exit(1)
  
      admin_path = os.path.join(os.getcwd(), 'admin')
      os.chdir(admin_path)
      with open('views.py', 'r+') as f:
          prev = pos = 0
          while f.readline():
              prev, pos = pos, f.tell()
          f.seek(prev)
          f.write(
              '\nfrom app.models import %s\nadmin.add_view(ModelView(%s, db.session))'
              % (module, module)
          )
  
      logger.info('''\033[33m{Info}\033[0m: add module done!''')
docs: add sql modules into admin site