我正在尝试使用postgress在google应用程序引擎上部署django应用程序,但我对可能导致此错误的原因已经没有想法了。
一切都很完美,但是当我要登录到django-admin时,它抛出了这个错误。
ProgrammingError at /admin/login/
relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
我不明白是怎么回事。我无法将新字段添加到模型中,每次运行makemigrations时都会得到以下错误:
django.db.utils.ProgrammingError: column "..." does not exist
是的,列不存在。这就是我想运行迁移的原因。
'ENGINE': 'django.contrib.gis.db.backends.postgis',
我已经在现有的Model中创建了一个boolean列并进行了迁移。我可以在表中看到具有默认值的列。但是在运行./manage.py测试时,我得到了以下错误。
psycopg2.errors.UndefinedColumn: column xxxx does not exist
LINE 1:
django.db.utils.ProgrammingError: column xxxx does not exist
LINE 1:
我正在使用这个流行的教程在AWS上部署django应用程序。
部署之后,我将得到以下错误:
ProgrammingError at /accounts/login/
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...
修正了其他人建议我做的事情:
我在我安装的应用程序中有“django.contrib.sites”(settings
在运行django测试之前,我正在尝试安装hstore扩展。为此,我重写了默认的DiscoverRunner's setup_databases方法。
但是,没有安装扩展&测试显示了这个错误django.db.utils.ProgrammingError: type "hstore" does not exist。
下面是我的代码来覆盖默认的发现运行程序。
settings.py
TEST_RUNNER = 'project.tests.CustomDiscovererRunner'
tests.py
from django.db imp
我在移民和heroku问题上有问题。我有一个在本地运行的django 1.7应用程序,但是在运行manage.py迁移时,我从heroku获得了以下消息错误:
django.db.utils.ProgrammingError: column "tag" of relation "website_classificado" does not exist
有什么想法吗?是否有一种通过heroku手动向postgres数据库添加列的方法?
非常感谢。
我正在尝试将Django项目从使用sqlite3迁移到使用PostgreSQL。我已经为项目创建了数据库,但是当我尝试运行syncdb时,我会得到以下错误:
django.db.utils.ProgrammingError: column "partial_value" cannot be cast automatically to type double precision
HINT: Specify a USING expression to perform the conversion.
该列在模型中的定义如下:
partial_value = models.FloatF
在进行迁移之后,我尝试进行迁移,但我得到了django.db.utils.ProgrammingError:表"products_customer“的列"id”指定的多个默认值。
但是我从models.py中删除了这个客户表--我是如何解决这个问题的?
models.py
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receive
很抱歉再问一遍,但我还没有得到任何解决方案。我的django博客在本地运行良好,但在部署到heroku后,我开始出现错误。我能做些什么来解决这个问题呢?错误状态:"ProgrammingError at / relation "posts_post" does not exist LINE 1: ...evious_post_id", "posts_post"."next_post_id" FROM "posts_pos..."
No changes detected说:我试图将AbstractUser子类化,但在运行migrate和makemigrations时遇到错误
django.db.utils.ProgrammingError: relation "auth_group" does not exist
型号:
class SubClient(AbstractUser):
client_id = models.ForeignKey(Client)
phone = models.CharField(max_length=15)
在settings.py中添加:
AUTH_USER_
我使用django 1.8,我有一个参考django.contrib.contenttypes.ContentType的模型:
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
class TaggedItem(models.Model):
tag = models.SlugField()
content_type = m
我试图重命名Django模型的主键字段,但是我得到了django.db.utils.ProgrammingError: column "new_name" of relation "my_app_mymodel" does not exist。
模型是这样的:
from django.db import models as django_db_models
class MyModel(django_db_models.Model):
old_name = django_db_fields.BigAutoField(
因此,我尝试在django应用程序上运行初始迁移,当我尝试运行迁移命令(python、manage.py、migrate或makemigrations)时,我收到以下错误:
psycopg2.ProgrammingError: relation "dotworks_server_internship" does not exist
LINE 1: ...s", "dotworks_server_internship"."questions" FROM "dotworks_...
我读过医生和这篇文章..。
我照它说的做了,但我还是不能让它开始工作。当我试图运行迁移时,我在回溯中得到了这个错误.
django.db.utils.ProgrammingError: column "author_id" cannot be cast automatically to type integer
HINT: You might need to specify "USING author_id::integer".
我只是不知道该怎么纠正这个错误。
from django.db import models
from django.contrib.
我试图在现有模型中添加两个日期字段(target_date & actual_date)。现有表中已经有一个日期字段(report_date)。
这些字段的默认值(target_date& actual_date)应该比report_date多5天。
下面是我的代码。
Models.py
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils import timezone
from datetime import date, time,
错误在中的模板呈现过程中,我试图运行服务器,但是它总是显示这个错误。我该如何解决这个问题。
在我的item_list.html里
{% extends "main/base.html" %}
{% block body %}
<h1>Here is the list of items.</h1>
{% for item in items %}
{{ item }}
{% endfor %}
{% endblock %}
在base.html中
<!DOCTYPE html>
<htm
我开始开发一个基于Django的web应用程序。一切都很好,直到我为我在PostgreSql中创建的数据库安装了Psycopg2。现在,当我试图打开站点中的任何页面时,都会抛出ProgrammingError: relation "django_session" does not exist错误。
Request Method: GET
Request URL: http://127.0.0.1:8000/login/
Django Version: 1.7
Exception Type: ProgrammingError
Exception Va
嗨,我是django的新手,做了一个生物数据表单,但问题是,当我试图将表单保存到db时,它会出现错误- (1146,“表'django_db.tictactoe_biodata‘不存在”)
如有任何帮助,将不胜感激。)
我的views.py
from django.shortcuts import render
from model import BiodataForm, Biodata
def get_name(request):
if request.method == 'POST':
post = request.POST
这是一段简单的上传图片的代码,我得到了这种类型的错误。
from django.db import models
from PIL import Image
class Products(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField()
description = models.CharField(max_length=500,blank=True,null=True)
我已经在互联网上找过了,我的问题可能是django管理工具中的错误,但它可能不是。
我正在尝试使用django管理工具向非默认数据库添加记录。我已经按照文档中的描述将我的admin.py设置为使用MultiDBModel管理。
class MultiDBModelAdmin(admin.ModelAdmin):
# A handy constant for the name of the alternate database.
using = 'brite_obs'
def save_model(self, request, obj, form, ch
我在Django 1.6.5中有一个应用程序。我有一个模型,我删除了一个字段,添加了另一个字段,并升级了第三个字段。当我们现在转到管理面板中的模型时,我得到了消息:
ProgrammingError at /admin/app/subscription/
column app_subscription.enabled does not exist
命令python manage.py syncdb不起作用。
我在Django有一个使用SQLite作为数据库的项目,它工作得很好。现在,我希望将数据库从SQLite更改为PostgreSQL。我更改了settings.py文件并安装了psycopg2。问题是,当我想要运行python manage.py migrate时,我在CMD中遇到了错误,它说: ...
django.db.utils.ProgrammingError: cannot cast type bytea to boolean
LINE 1: ...ansactionType" TYPE boolean USING "TransactionType"::boo