2014-10-29 1 views
2

사용자 인증을 위해 django-allauth를 사용하려고합니다. FB 로그인이 작동하지 않습니다. "allauth"테이블이 동기화되지 않았기 때문에 문제가 발생했는지 궁금합니다.사우스와 django-allauth : 어떻게 모든 테이블을 동기화 할 수 있습니까?

그러나 테이블을 "마이그레이션"할 수 없습니다. 그것은 "마이그레이션"을 말하지만 "마이그레이션"은 오류를 던집니다. 나는 분명히 트릭을 놓치고있다. 어떤 제안?

(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py syncdb 
Syncing... 
Creating tables ... 
Installing custom SQL ... 
Installing indexes ... 
Installed 0 object(s) from 0 fixture(s) 

Synced: 
> django.contrib.admin 
> django.contrib.auth 
> django.contrib.contenttypes 
> django.contrib.sessions 
> django.contrib.messages 
> django.contrib.staticfiles 
> storages 
> evernote 
> discover 
> hello 
> south 
> django.contrib.sites 
> djrill 

Not synced (use migrations): 
- polls 
- allauth 
- allauth.account 
- allauth.socialaccount 
- allauth.socialaccount.providers.facebook 
(use ./manage.py migrate to migrate these) 
(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py migrate allauth 
Running migrations for allauth: 
- Nothing to migrate. 
- Loading initial data for allauth. 
Installed 0 object(s) from 0 fixture(s) 
(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py migrate allauth.account 
? You have no migrations for the 'account' app. You might want some. 
(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py schemamigration allauth.account --auto 
You cannot use --auto on an app with no migrations. Try --initial. 
(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py schemamigration allauth.account --initial 
+ Added model account.EmailAddress 
+ Added model account.EmailConfirmation 
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate account 
(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py migrate allauth.account 
Running migrations for account: 
- Migrating forwards to 0001_initial. 
> account:0001_initial 
FATAL ERROR - The following SQL query failed: CREATE TABLE "account_emailaddress" ("id" serial NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "email" varchar(75) NOT NULL UNIQUE, "verified" boolean NOT NULL, "primary" boolean NOT NULL) 
The error was: relation "account_emailaddress" already exists 

그래서 내 혼란이 있습니다. 왜 이미 존재한다면 테이블을 만들려고합니까? 다른 스레드를 바탕으로

, 여기 경우에 유용 핍 동결입니다 :

(app01)MoriartyMacBookAir13:getstartapp macuser$ pip freeze 
Django==1.6.5 
Pillow==2.6.1 
South==1.0 
boto==2.32.1 
dj-database-url==0.3.0 
dj-static==0.0.6 
django-allauth==0.18.0 
django-audiotracks==0.2.4 
django-storages==1.1.8 
django-toolbelt==0.0.1 
djrill==1.2.0 
docopt==0.4.0 
evernote==1.25.0 
gunicorn==19.0.0 
httplib2==0.9 
mandrill==1.0.56 
mutagen==1.22 
oauth2==1.5.211 
oauthlib==0.6.3 
psycopg2==2.5.3 
pydub==0.9.2 
python-openid==2.2.5 
requests==2.3.0 
requests-oauthlib==0.4.1 
static3==0.5.1 
whitenoise==1.0.3 
wsgiref==0.1.2 
youtube-dl==2014.09.25 

그리고 확인, 위의 루프에도 불구하고, 나는 다시 내가 시작한 곳 이니

(app01)MoriartyMacBookAir13:getstartapp macuser$ python manage.py syncdb 
Syncing... 
Creating tables ... 
Installing custom SQL ... 
Installing indexes ... 
Installed 0 object(s) from 0 fixture(s) 

Synced: 
> django.contrib.admin 
> django.contrib.auth 
> django.contrib.contenttypes 
> django.contrib.sessions 
> django.contrib.messages 
> django.contrib.staticfiles 
> storages 
> evernote 
> discover 
> hello 
> south 
> django.contrib.sites 
> djrill 

Not synced (use migrations): 
- polls 
- allauth 
- allauth.account 
- allauth.socialaccount 
- allauth.socialaccount.providers.facebook 
(use ./manage.py migrate to migrate these) 

어떻게 나는 모든 테이블을 "동기화"되게합니까?

+0

@rnevius을, 당신은 무엇을 의미합니까? 내가 생각 ... 내가 남쪽으로 docs에서 schemamigration 등 http://south.readthedocs.org/en/latest/tutorial/part1.html#converting-existing-apps – Mark

답변

0

이것은 정상입니다. syncdb을 수행 할 때 South에서 관리하는 테이블을 동기화 할 필요가 없습니다. 당신은 남쪽에 해당 테이블 관리 할 필요가

(. DB를 이러한 변경 사항을 적용 migrate와 다음 모델의 변화를 감지하고 마이그레이션 파일을 생성하고 기본적으로 schemamigration와 함께 난 당신이 tutorial of South 읽기 권장)

당신이 syncdb 하나의 선으로 마이그레이션 할 경우

그리고 마지막으로, 당신은 이런 식으로 작업을 수행 할 수 있습니다

python manage.py syncdb --migrate 
+1

작동 했나요? 그렇다면 대답을 수락하고 upvote하시기 바랍니다. 감사! – ferrangb

관련 문제