django 注册。试试 Django 1.8 教程。 /accounts/register/ 处的操作错误

django-registration. Try Django 1.8 Tutorial. OperationalError at /accounts/register/

昨天我学习了 CodingEntrepreneurs 的教程 django 课程。完成申请后,我尝试使用注册,但出现以下错误:

OperationalError at /accounts/register/
table registration_registrationprofile has no column named activated

我尝试运行本课程的 github 存储库服务器 (link-https://github.com/codingforentrepreneurs/Try-Django-1.8),我得到了相同的结果。

Makemigrations/migrate- 试过了。给我:

    return Database.Cursor.execute(self,query)django.db.utils.OperationalError: 
table "registration_registrationprofile" already exists

问题描述如下:

Django Version: 1.9.1
Python Version: 2.7.10
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'crispy_forms',
 'registration',
 'newsletter')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware')



Traceback:

(skip)

File "/home/popovvasile/Desktop/programming/trydjanggo/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
  323.         return Database.Cursor.execute(self, query, params)

Exception Type: OperationalError at /accounts/register/
Exception Value: table registration_registrationprofile has no column named activated

这是已部署站点的示例 - https://nix1947.herokuapp.com/。 使用注册(不是报名表)会报错。

link 课程 - https://www.youtube.com/watch?v=KsLHt3D_jsE&list=PLEsfXFp6DpzRcd-q4vR5qAgOZUuz8041S

有人听过同样的辅导课程吗?谢谢你。

我认为你正在使用 django-registration 包而不是 django-registration-redux

  1. 移除 django-registration
  2. 安装django-registration-redux
  3. 迁移

对我有帮助

Django 2.0.2,python3.6.4

我有同样的问题 我已经将 requirement.txt 更改为:

Django==1.8.17
django-crispy-forms==1.6.1
django-registration-redux==1.1

和运行在命令行

pip3 install -r requirements.txt