【问题标题】:how to use django-valuate?如何使用 django-value?
【发布时间】:2012-02-24 18:07:09
【问题描述】:

我使用的是标点系统this site,我只是使用自带的示例,我没有创建任何应用程序只是使用示例,我已经完成了syncdb,添加在管理员中。

喜欢不喜欢

  • 喜欢 1
  • 不喜欢 0

我也给模型帖添加了记录,但是当我转到 127.0.0.1:8000 时出现下一个错误:

DoesNotExist at / ValuationType 匹配查询不存在。要求 方法:GET 请求地址:http://127.0.0.1:8000/ Django 版本:1.3.1 异常类型:DoesNotExist 异常值:ValuationType 匹配 查询不存在。异常位置:C:\Python27\lib\ site-packages\django\db\models\query.py 在 get 中,第 349 行 Python 可执行文件:C:\Python27\python.exe Python 版本:2.7.2 Python 路径:['D:\\Django\\AppFabric\\vote\\sample','C: \ \ Python27 \ \ lib \ \ 站点包\ \ django_pure_pagination-0.1-py2.7.egg','C:\\Python27\\lib\\ 站点包\ \ django_uni_form-0.9.0-py2.7.egg','C:\ \ Python27 \ \ lib \ \ 站点包\ \ django_email_confirmation-0.2-py2.7.egg','C:\\Python27\\lib\ \site-packages\python_openid-2.2.5-py2.7.egg','C:\Python27 \ \ lib \ \ 站点包\ \ oauth2-1.5.211-py2.7.egg','C:\ \ Python27\\lib\\site-packages\\httplib2-0.7.2-py2.7.egg',
'C:\\Python27\\lib\\site-packages\0.8.0rc2-py2.7.egg 模拟-','C:\ \ Python27 \ \ lib \ \ site-packages \ \ pip-1.0.2, py2.7.egg''C:\\Python27\\lib\\site-packages\ django_socialauth-0.1.2c-py2.7.egg','C:\\Python27\\lib\\ 站点包\ \ oauth-1.0.1-py2.7.egg','C:\ \ Python27 \ \ lib \ \ 站点包\ \ django_socialregistration-0.5-py2.7.egg','C:\ \ Python27 \ \ lib \ \ 站点包\ \ django_disqus-0.4.1-py2.7.egg','C:\\Python27\\lib\\ 站点包\ \ django_threadedcmets-0.9-py2.7.egg','C:\ \ Python27 \ \ lib \ \ 站点包\ \ django_valuate-1.0_beta_2.2-py2.7.egg','C:\\Windows\\system32 \ \ python27.zip''C:\\Python27\\DLLs','C:\\Python27\ lib','C:\\Python27\\lib\\plat-win''C:\\Python27\\ lib \ \ lib-tk','C:\ Python27','C:\ \ Python27 \ \ lib \ \ 站点包','C:\ \ Python27 \ \ lib \ \站点包\ \ PIL' '../', '../']

【问题讨论】:

    标签: django


    【解决方案1】:

    诀窍是转到http://localhost:8000/admin 并使用名为like-dislike 的slug 创建一个ValuationType,这样你的错误就会消失。如果您想弄乱主应用程序,您还需要创建几个帖子。

    需要注意的其他事项是,如果您创建/删除了一些内容,您将进入错误状态,因为它们使用 pk=1 重新开始,只需删除 db.sqlite。

    祝你好运。

    【讨论】:

    • 问题出在模板 home.html 的第 7、9、11 行,因为它必须是您放入 ValuateType 的名称,Tanks
    猜你喜欢
    • 2019-07-11
    • 2018-07-01
    • 2021-06-10
    • 2021-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    相关资源
    最近更新 更多