我花了很多时间来解决这个问题,但没有成功。我仍然被困在这里。
因为我已经使用django-deployer在 GAE(Google App Engine)上部署了一个 django 项目,并且我正在我的 django 项目中实现django-social-auth。这是详细的问题
本地主机:8000 -
home/dev/djangoTaxi# python manage.py syncdb
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory
Creating table scheduler_client
Creating table scheduler_clientevaluation
Creating table scheduler_car
Creating table scheduler_taxi
Creating table scheduler_taxievaluation
Creating table scheduler_ride
Creating table scheduler_rideevaluation
Creating table registration_registrationprofile
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): db_admin
Email address: myemail@gmail.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> django.contrib.staticfiles
> django.contrib.admin
> south
> scheduler
> registration
Not synced (use migrations):
- social_auth
(use ./manage.py migrate to migrate these)
当我运行migrate
命令时,我得到这个:
home/dev/djangoTaxi# python manage.py migrate
Running migrations for social_auth:
- Migrating forwards to 0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati.
> social_auth:0001_initial
> social_auth:0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati
- Loading initial data for social_auth.
Installed 0 object(s) from 0 fixture(s)
以下是mysql中列出的数据库表:
mysql> show tables;
+----------------------------------+
| Tables_in_db_taxi |
+----------------------------------+
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| django_admin_log |
| django_content_type |
| django_session |
| django_site |
| registration_registrationprofile |
| scheduler_car |
| scheduler_client |
| scheduler_clientevaluation |
| scheduler_ride |
| scheduler_rideevaluation |
| scheduler_taxi |
| scheduler_taxievaluation |
| social_auth_association |
| social_auth_nonce |
| social_auth_usersocialauth |
| south_migrationhistory |
+----------------------------------+
22 rows in set (0.00 sec)
由于此迁移命令通过 social_auth 创建所需的表。它在本地服务器上运行良好。
GAE: 但是这些社交身份验证表没有填充到 Google Cloud SQL 上。这是详细信息。使用 django-deployer 命令的 Google Cloud SQL (GAE)。
/djangoTaxi# sh manage.sh cloudsyncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Instlled 0 object(s) from 0 fixture(s)
Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> django.contrib.staticfiles
> django.contrib.admin
> south
> scheduler
> rocket_engine
> registration
Not synced (use migrations):
- social_auth
(use ./manage.py migrate to migrate these)
为了解决这个问题,我尝试了以下方法:
hom/dev/djangoTaxi# sh manage.sh migrate
Running migrations for social_auth:
- Nothing to migrate.
- Loading initial data for social_auth.
Installed 0 object(s) from 0 fixture(s)
然后它不会填充 GAE 上的 social_auth 表。因此,我反复收到此错误。
DatabaseError at /complete/google-oauth2/
(1146L, u"Table 'db_DjangoTaxi.social_auth_usersocialauth' doesn't exist")
谁能帮我解决这个问题,以便 social_auth 在谷歌应用引擎上正常工作。
谢谢,