你好我是python,django和编程的新手。 在尝试使用Django创建应用程序时,我正在关注该网站的教程,我可以##
运行用于创建超级用户的命令,但每次我尝试插入所请求的名称时,它都会给我这个错误:
"Error: Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.
Username (leave blank to use 'joao'):"
是的,它每次都会一直显示此错误 有人可以帮忙吗?
Models.url
import datetime
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length = 200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length = 200)
votes = models.IntegerField(default = 0)
def __str__(self):
return self.choice_text
提前致谢
答案 0 :(得分:0)
错误很清楚。创建超级用户时,只能输入字母,数字和指定的字符。它与你的模型无关。