from django.db import models from django.contrib.auth.models import User # 公钥表 class PublicKey(models.Model): # 对应django自带的user user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='public_key') # 公钥 public_key = models.CharField(max_length=1025, blank=False, unique=True)