0
django_mongodb_engine
및 mongolab
을 사용하는 앱이 있습니다 (python manage.py syncdb는 필요하지 않음). 또한 로컬 서버로 foreman
을 사용하고 있습니다.python manage.py runserver 대 사용자가 직접 foreman 시작 사용자 모델
Procfile는 :
web: gunicorn <appname>.wsgi
나는 다음과 같은 사용자 정의 사용자 모델 Registration
라는이 : 나는 foreman start
에 입력 할 때
class Registration(AbstractBaseUser):
username = models.CharField(max_length=50)
email = models.CharField(max_length=50)
created_at = models.DateTimeField()
zone = models.IntegerField()
objects = RegistrationManager()
USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['created_at', 'zone']
지금, 그것이 내가이되고 싶어 정확히 어떻게 작동합니다. 즉 not unique
로 USERNAME_FIELD
입니다,하지만 난 python manage.py runserver
함께 할 때 모델을 검증하는 동안, 그것은 나에게 다음과 같은 오류 제공 : 내가 Heroku가에 배포 할 때
CommandError: The USERNAME_FIELD must be unique. Add unique=True to the field parameters.
가 잘 작동합니다.
로 정의하지만 감독과 함께 그나마 또는 오히려 gunicorn 경우에도 작동해야 – chaitanya90