2012-03-06 5 views
2

django-userena 데모 프로젝트를 테스트하고 있습니다. sendmail을 설치했습니다. 내가 syncdb를 실행하면이 오류가 표시되는 이유

Environment: 


Request Method: POST 
Request URL: http://127.0.0.1:8000/accounts/signup/ 

Django Version: 1.3.1 
Python Version: 2.7.2 
Installed Applications: 
['django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.sites', 
'django.contrib.messages', 
'django.contrib.admin', 
'easy_thumbnails', 
'guardian', 
'south', 
'userena', 
'userena.contrib.umessages', 
'demo_project.profiles'] 
Installed Middleware: 
('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.locale.LocaleMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'userena.middleware.UserenaLocaleMiddleware') 


Traceback: 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 
    111.       response = callback(request, *callback_args, **callback_kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/decorators.py" in _wrapped_view 
    28.   return view_func(request, *args, **kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/views.py" in signup 
    69.   if form.is_valid(): 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in is_valid 
    121.   return self.is_bound and not bool(self.errors) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in _get_errors 
    112.    self.full_clean() 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in full_clean 
    267.   self._clean_fields() 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in _clean_fields 
    287.      value = getattr(self, 'clean_%s' % name)() 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/forms.py" in clean_username 
    49.    user = User.objects.get(username__iexact=self.cleaned_data['username']) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in get 
    132.   return self.get_query_set().get(*args, **kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in get 
    344.   num = len(clone) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in __len__ 
    82.     self._result_cache = list(self.iterator()) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator 
    273.   for row in compiler.results_iter(): 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter 
    680.   for rows in self.execute_sql(MULTI): 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 
    735.   cursor.execute(sql, params) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute 
    34.    return self.cursor.execute(sql, params) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute 
    86.    return self.cursor.execute(query, args) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute 
    174.    self.errorhandler(self, exc, value) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler 
    36.  raise errorclass, errorvalue 

Exception Type: DatabaseError at /accounts/signup/ 
Exception Value: (1146, "Table 'demo_project.auth_user' doesn't exist") 

편집

앞서이 질문을 업데이트 할 수 없습니다 미안 해요, 난, 너무 바빠서, 내가이 참조 : 가입하면

나는이 오류가 표시 오류

Environment: 


Request Method: POST 
Request URL: http://127.0.0.1:8000/accounts/signup/ 

Django Version: 1.3.1 
Python Version: 2.7.2 
Installed Applications: 
['django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.sites', 
'django.contrib.messages', 
'django.contrib.admin', 
'easy_thumbnails', 
'guardian', 
'south', 
'userena', 
'userena.contrib.umessages', 
'demo_project.profiles'] 
Installed Middleware: 
('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.locale.LocaleMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'userena.middleware.UserenaLocaleMiddleware') 


Traceback: 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 
    111.       response = callback(request, *callback_args, **callback_kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/decorators.py" in _wrapped_view 
    28.   return view_func(request, *args, **kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/views.py" in signup 
    70.    user = form.save() 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/forms.py" in save 
    86.              userena_settings.USERENA_ACTIVATION_REQUIRED) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/managers.py" in create_user 
    62.   userena_profile = self.create_userena_profile(new_user) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/managers.py" in create_userena_profile 
    104.       activation_key=activation_key) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in create 
    138.   return self.get_query_set().create(**kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in create 
    360.   obj.save(force_insert=True, using=self.db) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/base.py" in save 
    460.   self.save_base(using=using, force_insert=force_insert, force_update=force_update) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base 
    553.      result = manager._insert(values, return_id=update_pk, using=using) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in _insert 
    195.   return insert_query(self.model, values, **kwargs) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in insert_query 
    1436.  return query.get_compiler(using=using).execute_sql(return_id) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 
    791.   cursor = super(SQLInsertCompiler, self).execute_sql(None) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 
    735.   cursor.execute(sql, params) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute 
    34.    return self.cursor.execute(sql, params) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute 
    86.    return self.cursor.execute(query, args) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute 
    174.    self.errorhandler(self, exc, value) 
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler 
    36.  raise errorclass, errorvalue 

Exception Type: DatabaseError at /accounts/signup/ 
Exception Value: (1146, "Table 'demo_project.userena_userenasignup' doesn't exist") 

2 EDIT

이3210이 ./manage.py migrate

Running migrations for easy_thumbnails: 
- Nothing to migrate. 
- Loading initial data for easy_thumbnails. 
No fixtures found. 
Running migrations for guardian: 
- Nothing to migrate. 
- Loading initial data for guardian. 
No fixtures found. 
Running migrations for userena: 
- Nothing to migrate. 
- Loading initial data for userena. 
No fixtures found. 
Running migrations for umessages: 
- Nothing to migrate. 
- Loading initial data for umessages. 
No fixtures found. 

의 출력 내가 오류를보고하고 바로 그겁니다, 사용자 이름과 이메일을 DB에 저장되는 점에 유의하시기 바랍니다있다 syncdb

Syncing... 
Creating tables ... 
Installing custom SQL ... 
Installing indexes ... 
No fixtures found. 

Synced: 
> django.contrib.auth 
> django.contrib.contenttypes 
> django.contrib.sessions 
> django.contrib.sites 
> django.contrib.messages 
> django.contrib.admin 
> south 
> demo_project.profiles 

Not synced (use migrations): 
- easy_thumbnails 
- guardian 
- userena 
- userena.contrib.umessages 
(use ./manage.py migrate to migrate these) 

의 출력입니다. manage.py syncdb

당신은 밖으로 일했다 : 나는 그것을 당신은 syncdb가 실행해야

That e-mail address doesn't have an associated user account. Are you sure you've registered?

+0

@Mat 죄송합니다. 죄송합니다. 오류가 크다고 생각 했으므로 질문을 가능한 한 짧게하려고했으나 바로 답변을 드리겠습니다. – user

답변

3

데이터베이스를 삭제해야한다고 생각합니다. 그런 다음 신선한 DB에서 manage.py syncdbmanage.py migrate을 다시 실행하십시오. manage.py migrate을 실행하면 게시 한 결과가 제공되지 않습니다. 출력 결과가 변경되지 않거나 테이블을 만들지 않아 문제가 될 수 있습니다. 아마도 필요한 테이블이 만들어지지 않았을 수도 있습니다. This is what the output should look like after a manage.py syncdb.

  • This is what the output should look like after a manage.py migrate.
    1. 당신은 userena와 함께 제공되는 demo_project에 대해 총 21 개 테이블이 있어야합니다.


      이 프로젝트를 수행하는 단계는 일반적으로 도움이됩니다.

      1. manage.py syncdbmanage.py migrate
      2. 실행을
      3. 프로젝트 디렉토리에 VIRTUALENV, CD를 활성화 userena와 함께 제공되는 demo_project을 당겨 할 프로젝트를 가상 환경과 pip install django-userena
      4. 만들기

      나는 이것을 지금까지 마쳤다. 이 단계가 완료되면 demo_project 모자가 작동합니다.

      * /accounts/signup/ 페이지에서 사용자를 등록하는 경우 기억하십시오. 이 사용자는 기본적으로 /admin/에 로그인 할 수 없습니다. 수퍼 유저 사용자는 관리자에게 프로파일을 제공하지 않으면 /accounts/(profile)/ 아래에서 자신의 프로파일에 액세스 할 수 없습니다.

    +0

    을 읽어주세요. [this] (http://pastebin.com/KjJBgrb9) 오류는 정상입니까? – user

    +0

    아니요 정상이 아닙니다. 전혀 오류가 없어야합니다. 언제 그 오류가 발생합니다. 새로운 사용자를 가입하려고 할 때 발생합니까? – darren

    +0

    가입 후,'syncdb'와'migrate'의 출력은 당신이 설명한대로 exaclty입니다. – user

    5

    말한다 비밀번호를 재설정하려고하면

    내가 로그인하는 경우, 그것은 your account has been disabled

    말한다 다양한 남쪽 명령을 사용해야합니다.

    이제 두 가지 질문이 생깁니다. 남쪽에서 실행 한 후에도 여전히 이러한 오류가 발생합니까? 둘째, 오류 메시지 (Exception Value: (1146, "Table 'demo_project.userena_userenasignup' doesn't exist"))에 지정된 테이블이 실제로 있습니까? 테이블이 존재하면 데이터베이스가 제대로 작동하는지 조사하고, 존재한다면 테이블이 올바른 데이터베이스에 있는지 확인하십시오.

    +0

    제 편집을 읽어주세요. sit – user

    +0

    @user : syncdb를 실행할 때 오류가 발생하지 않습니다. – Marcin

    +0

    syncdb를 실행하지 않았기 때문에 첫 번째 오류가 발생했으나 syncdb를 실행 한 후 두 번째 오류가 발생했습니다. – user

    관련 문제