我在Heroku上运行了我的Django应用程序,但现在我想将它迁移到我自己的web服务器上。除了PostgreSQL数据库之外,一切都很顺利:我从Heroku导出了数据库,并将转储文件导入到我自己的PostgreSQL中。当我运行python manage.py syncdb时,我得到以下错误:
django.db.utils.ProgrammingError: no schema has been selected to create in
当我在浏览器中打开任何页面时,我得到这个错误:
relation "django_session" does not exist
LI
我正在学习在Ubuntu11.10中同时使用PostgreSQL和Django,我发现我需要切换到我在终端安装PostgreSQL ("postgres")时创建的用户(通过"sudo su postgres"),以便在Django中创建和访问数据库。不幸的是,"postgres"用户在我的本地文件系统上没有文件写入权限,所以当我尝试执行某些操作时,比如将模型对象添加到具有图像字段的数据库中时,我会被阻止。但是,如果我在终端中切换到我的普通Ubuntu用户名,并尝试在Django的开发服务器上访问我的管理站点,我会得到如下错误:
Operatio
我在Django项目中创建了PostgreSQL。当我对数据库执行迁移时,它返回此异常。
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.postgresql'
isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'sqlite3'
我尝试了pos
如何诊断PostgreSQL性能问题?
我有一个基于Django的webapp,在Ubuntu12上使用PostgreSQL作为数据库后端,在繁重的负载下,数据库似乎就消失了,导致Django界面无法访问,并导致以下错误:
django.db.utils.DatabaseError: error with no message from the libpq
django.db.utils.DatabaseError: server closed the connection unexpectedly
This probably means the server terminated
我正在尝试运行django迁移来更新我的数据库,但是"manage.py迁移“无法连接到我的postgresql数据库。奇怪的是:我的django网站(这是完全相同的代码)正在工作,包括连接到数据库。
错误消息:
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run
我正在创建一个startproject,并试图使用命令行迁移默认django模式:
manage.py migrate
结果是:"Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?"
我正在使用一个虚拟环境,并安装了下一个依赖项:
Django==2.1.2
psycopg2==2.7.5
pytz==2
我目前正在阅读Antonio Mele的"Django 3 By Example“。第3章让我完成创建博客应用程序的工作。在本章中,它让我将数据库从MySQL更改为PostgreSQL,然后迁移数据。当我迁移数据时,我得到这个错误: **django.db.utils.ProgrammingError: cannot cast type timestamp with time zone to boolean
LINE 1: ..." ALTER COLUMN "active" TYPE boolean USING "active"::boole
我目前有一个Django驱动的生产中web应用程序,其中包含多个型号,位于Postgresql数据库(Google Cloud SQL)之上。
在初始设置过程中,其中一个模型的设置如下:
class ExampleModel(models.Model):
id = models.CharField(max_length=60, unique=True, primary_key=True)
new_id = models.CharField(max_length=60, unique=True, null=True, db_index=True)
name = model