DatabaseError:当前事务被中止,命令被忽略,直到manage.py syncdb上的事务块结束

时间:2017-11-04 23:58:38

标签: django postgresql

我克隆了一个现有的django项目,并在Windows 10上的virtualenv上进行了设置。我安装了以下工具;

Django==1.5.1
pillow==2.5.1
South==1.0.2
django-autocomplete-light==1.1.7
django-haystack==2.3.1
django-memcache-status==1.1
#django-mptt==0.5.4
mailsnake==1.6.3
psycopg2==2.4.5
requests==1.1.0
simplejson==3.1.0
sorl-thumbnail==11.12
textile==2.1.5
#xapian-haystack==1.1.5beta
gunicorn==19.1.1
#pycurl==7.19.5
django-widget-tweaks==1.3
pycountry==1.10
django-jsonfield==0.9.13
python-dateutil==2.3
geopy==1.7.0
whoosh==2.5.7
structlog==15.1.0
celery==3.1.17
python-memcached==1.54

我正在使用postgresql 9.6。

当我运行python manage.py syncdb时,我得到了上述错误,有趣的是当我注释掉所有其他应用程序时,与Django一起成功同步的应用程序。

以下是来自pg_log;

的错误日志
ERROR:  relation "pages_entrytype" does not exist at character 755
STATEMENT:  SELECT "pages_entrytype"."id", "pages_entrytype"."created", 
"pages_entrytype"."created_by_id", "pages_entrytype"."modified", 
"pages_entrytype"."modified_by_id", "pages_entrytype"."visible", 
"pages_entrytype"."name", "pages_entrytype"."title", 
"pages_entrytype"."header", "pages_entrytype"."description", 
"pages_entrytype"."meta_description", "pages_entrytype"."content", 
"pages_entrytype"."sortorder", "pages_entrytype"."system_required", 
"pages_entrytype"."old_id", "pages_entrytype"."old_table", 
"pages_entrytype"."parent_id", "pages_entrytype"."lft", 
"pages_entrytype"."rght", "pages_entrytype"."tree_id", 
"pages_entrytype"."level", "pages_entrytype"."slug", 
"pages_entrytype"."bookable", "pages_entrytype"."icon", 
"pages_entrytype"."icon_hover" FROM "pages_entrytype" WHERE 
UPPER("pages_entrytype"."name"::text) = UPPER('accommodation'). 
ERROR:  current transaction is aborted, commands ignored until end of 
transaction block.
STATEMENT:  SELECT c.relname FROM pg_catalog.pg_clasLEFT JOIN 
pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r', 
'v', '') AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND 
pg_catalog.pg_table_is_visible(c.oid)
LOG:  could not receive data from client: An existing connection was 
forcibly closed by the remote host.

我确保模型中的延迟加载。

0 个答案:

没有答案