/contact/ 处的编程错误是什么意思



我刚刚在我的应用程序中添加了一个联系表单,然后在我提交表单时返回了这个。我的代码没有blog_quotes,当我进行迁移时,没有任何变化。

ProgrammingError at /contact/
relation "blog_quotes" does not exist
LINE 1: INSERT INTO "blog_quotes" ("name", "email", "description") V...
                ^
Request Method: POST
Request URL:    https://myapp.herokuapp.com/contact/
Django Version: 2.1.9
Exception Type: ProgrammingError
Exception Value:    
relation "blog_quotes" does not exist
LINE 1: INSERT INTO "blog_quotes" ("name", "email", "description") V...
                ^
Exception Location: /app/.heroku/python/lib/python3.6/site- packages/django/db/backends/utils.py in _execute, line 85
Python Executable:  /app/.heroku/python/bin/python
Python Version: 3.6.8
Python Path:    
['/app/.heroku/python/bin',
 '/app',
 '/app/.heroku/python/lib/python36.zip',
 '/app/.heroku/python/lib/python3.6',
 '/app/.heroku/python/lib/python3.6/lib-dynload',
 '/app/.heroku/python/lib/python3.6/site-packages']
Server time:    Sun, 16 Jun 2019 23:57:25 +0800

这是我的 forms.py

from django import forms
from django.forms import ModelForm
from .models import Contact
class ContactForm(ModelForm):
    required_css_class = 'required'
    class Meta:
        model = Contact
        fields = [
            'name', 'email', 'description',
        ]

我的 models.py

class Contact(models.Model):
    name = models.CharField(max_length=100)
    email = models.EmailField()
    description = models.TextField()
    def __str__(self):
        return str(self.id)
    class Meta:
        verbose_name = "contact"
        verbose_name_plural = "contacts"

我错过了什么?

如果这是一个起始项目,您可以尝试将所有迁移重置为零,删除迁移文件,重新创建并重新运行它们。

最新更新