- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在学习 OSCAR 教程 (http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html),并试图让 Haystack 与 Solr 一起工作。我已经设置了 postgres。我在 Cloud9 上运行。我尝试运行“$ python manage.py syncdb --noinput”这最终在运行迁移时被杀死...
/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/haystack/utils/__init__.py:12: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils import importlib
/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/oscar/apps/catalogue/abstract_models.py:20: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
from django.contrib.contenttypes.generic import GenericForeignKey
/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py:24: RemovedInDjango19Warning: The syncdb command will be removed in Django 1.9
warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning)
Operations to perform:
Synchronize unmigrated apps: reports_dashboard, offers_dashboard, treebeard, communications_dashboard, reviews_dashboard, pages_dashboard, shipping_dashboard, haystack, promotions_dashboard, checkout, thumbnail, vouchers_dashboard, django_tables2, partners_dashboard, staticfiles, oscar, compressor, catalogue_dashboard, users_dashboard, search, messages, widget_tweaks, dashboard, ranges_dashboard, orders_dashboard
Apply all migrations: customer, promotions, shipping, wishlists, offer, admin, sessions, contenttypes, auth, payment, reviews, analytics, catalogue, flatpages, sites, address, basket, partner, order, voucher
Synchronizing apps without migrations:
Creating tables...
Creating table thumbnail_kvstore
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states...Killed
我也试过在没有 --noinput 的情况下运行它
/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/haystack/utils/__init__.py:12: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils import importlib
/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/oscar/apps/catalogue/abstract_models.py:20: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
from django.contrib.contenttypes.generic import GenericForeignKey
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 393, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 444, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 182, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL: database "oscar_vagrant" does not exist
如果我尝试运行服务器,它表明数据库未同步...当我尝试加载页面时,我得到这个...
ProgrammingError at /
relation "promotions_pagepromotion" does not exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "promotion...
^
Request Method: GET
Request URL: https://love-benbuehne.c9.io/
Django Version: 1.8.3
Exception Type: ProgrammingError
Exception Value:
relation "promotions_pagepromotion" does not exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "promotion...
^
Exception Location: /home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages/django/db/backends/utils.py in execute, line 64
Python Executable: /home/ubuntu/workspace/oscar/bin/python
Python Version: 2.7.6
Python Path:
['/home/ubuntu/workspace',
'/home/ubuntu/workspace',
'/home/ubuntu/lib/python/site-packages',
'/home/ubuntu/workspace/oscar/lib/python2.7',
'/home/ubuntu/workspace/oscar/lib/python2.7/plat-x86_64-linux-gnu',
'/home/ubuntu/workspace/oscar/lib/python2.7/lib-tk',
'/home/ubuntu/workspace/oscar/lib/python2.7/lib-old',
'/home/ubuntu/workspace/oscar/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/home/ubuntu/workspace/oscar/local/lib/python2.7/site-packages']
Server time: Fri, 10 Jul 2015 22:54:01 +0000
我有点搞不懂这是什么意思。似乎我在同步数据库时遇到了问题......而且似乎只是某种错误超出了我的范围。我什至不确定我可以将哪些文件复制到这里会有帮助。最好的我可以告诉 Django 正在访问 postgres ......并且由于一些奇怪的原因它没有同步。
最佳答案
删除数据库,删除迁移,然后根据需要运行 syncdb 或 makemigrations。可能这会有所帮助。 如果它不起作用,请向我展示您的模型文件。
关于python - 在 Django 中将 Postgres 与 Oscar 同步的编程错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31351611/
我想知道这里是否有人有安装 Postgres-XL 的经验,新的开源多线程版本的 PostgreSQL。我计划将一组 1-2 TB 的数据库从常规 Postgres 9.3 迁移到 XL,并且想知道这
我想创建一个 postgres 备份脚本,但我不想使用 postgres 用户,因为我所在的 unix 系统几乎没有限制。我想要做的是在 crontab 上以 unix 系统(网络)的普通用户身份运行
我正在尝试编写一个 node-postgres 查询,它采用一个整数作为参数在间隔中使用: const query = { text: `SELECT foo
如何在不使用 gui 的情况下停止特定的 Postgres.app 集群。 我想使用 bash/Terminal.app 而不是 gui 我还应该指出,Postgres 应用程序有一个这样的菜单 如果
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 9 年前。 Improve
我正在使用 docker 运行 Postgres 图像。它曾经在 Windows10 和 Ubuntu 18.04 上运行没有任何问题。 在 Ubuntu 系统上重新克隆项目后,它在运行 docker
我正在使用 python(比如表 A)将批处理 csv 文件加载到 postgres。我正在使用 pandas 将数据上传到更快的 block 中。 for chunk in pd.read_csv(
所以是的,标题说明了一切,我需要以某种方式将 DB 从源服务器获取到新服务器,但更重要的是旧服务器正在崩溃 :P 有什么方法可以将它全部移动到新服务器并导入它? 旧服务器只是拒绝再运行 Postgre
这主要是出于好奇而提出的问题。我正在浏览 Postgres systemd 单元文件,以了解 systemd 可以做什么。 Postgres 有两个 systemd 单元文件。一个用于代替 syste
从我在 pg_hba.conf 中读到的内容,我推断,为了确保提示我输入 postgres 用户的密码,我应该从当前的“对等”编辑 pg_hba.conf 的前两个条目的方法'到'密码'或'md5',
我已连接到架构 apm。 尝试执行函数并出现以下错误: ERROR: user mapping not found for "postgres" 数据库连接信息说: apm on postgres@
我在 ubuntu 12.04 服务器上,我正在尝试安装 postgresql。截至目前,我已成功安装它但无法配置它。我需要创建一个角色才能继续前进,我在终端中运行了这个命令: root@hostna
我无法以“postgres”用户身份登录到“postgres”数据库。操作系统:REHL 服务器版本 6.3PostgreSQL 版本:8.4有一个数据库“jiradb”用作 JIRA 6.0.8 的
我正在尝试将现有数据库导入 postgres docker 容器。 这就是我的处理方式: docker run --name pg-docker -e POSTGRES_PASSWORD=*****
我们的 Web 应用程序在 postgres 9.3 和 Grails 2.5.3 上运行。当我们重新启动 postgres (/etc/init.d/postgresql restart) 并访问网
我想构建 postgres docker 容器来测试一些问题。我有: postgres 文件的归档文件夹(/var/lib/postgres/data/) 将文件夹放入 docker postgres
我有一个名为“stuff”的表,其中有一个名为“tags”的 json 列,用于存储标签列表,还有一个名为“id”的列,它是表中每一行的主键。我正在使用 postgres 数据库。例如,一行看起来像这
我对 sqlalchemy-psql 中的锁定机制是如何工作的感到非常困惑。我正在运行一个带有 sqlalchemy 和 postgres 的 python-flask 应用程序。由于我有多个线程处理
我(必须)使用 Postgres 8.4 数据库。在这个数据库中,我创建了一个函数: CREATE OR REPLACE FUNCTION counter (mindate timestamptz,m
我已经使用 PostgreSQL 几天了,它运行良好。我一直在通过默认的 postgres 数据库用户和另一个具有权限的用户使用它。 今天中午(在一切正常之后)它停止工作,我再也无法回到数据库中。我会
我是一名优秀的程序员,十分优秀!