django: регистрация пользователя с ошибкой: нет такой таблицы: auth_user

Я пытаюсь использовать аутентификацию Django по умолчанию для обработки регистрации и входа в систему. И я думаю, что процедура довольно стандартная, но моя с чем-то не так.

мой setting.py:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'books',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

AUTH_USER_MODEL = 'books.User'

мои books.models.py:

class User(AbstractUser):
    account_balance = models.DecimalField(max_digits=5, decimal_places=2, default=0)

мои views.py:

from django.contrib.auth.forms import UserCreationForm

def register(request):
    if request.method == 'POST':
        form = UserCreationForm(request.POST)
        if form.is_valid():
            new_user = form.save()
            return HttpResponseRedirect("/accounts/profile/")
    else:
        form = UserCreationForm()
    return render(request, "registration/register.html", {'form': form,})

мой urls.py

urlpatterns = patterns('',
    (r'^accounts/login/

Даже я пытался удалить db.sqlite3 и повторноpython manage.py syncdbесть еще это сообщение об ошибке:

OperationalError at /accounts/register/
no such table: auth_user
Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.7b4
Exception Type: OperationalError
Exception Value:    
no such table: auth_user

Может кто-нибудь объяснить и сказать мне, что я должен делать?

, login), (r'^accounts/logout/

Даже я пытался удалить db.sqlite3 и повторноpython manage.py syncdbесть еще это сообщение об ошибке:

OperationalError at /accounts/register/
no such table: auth_user
Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.7b4
Exception Type: OperationalError
Exception Value:    
no such table: auth_user

Может кто-нибудь объяснить и сказать мне, что я должен делать?

, logout), (r'^accounts/profile/

Даже я пытался удалить db.sqlite3 и повторноpython manage.py syncdbесть еще это сообщение об ошибке:

OperationalError at /accounts/register/
no such table: auth_user
Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.7b4
Exception Type: OperationalError
Exception Value:    
no such table: auth_user

Может кто-нибудь объяснить и сказать мне, что я должен делать?

, profile), (r'^accounts/register/

Даже я пытался удалить db.sqlite3 и повторноpython manage.py syncdbесть еще это сообщение об ошибке:

OperationalError at /accounts/register/
no such table: auth_user
Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.7b4
Exception Type: OperationalError
Exception Value:    
no such table: auth_user

Может кто-нибудь объяснить и сказать мне, что я должен делать?

, register), )

Даже я пытался удалить db.sqlite3 и повторноpython manage.py syncdbесть еще это сообщение об ошибке:

OperationalError at /accounts/register/
no such table: auth_user
Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.7b4
Exception Type: OperationalError
Exception Value:    
no such table: auth_user

Может кто-нибудь объяснить и сказать мне, что я должен делать?

Ответы на вопрос(12)

Ваш ответ на вопрос