V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xiayibu
V2EX  ›  Python

django 这个错误如何解决,网上找不到解决办法

  •  
  •   xiayibu · Jul 3, 2017 · 4210 views
    This topic created in 3225 days ago, the information mentioned may be changed or developed.

    django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'title' used in key specification without a key length")

    5 replies    2017-07-03 21:13:43 +08:00
    goophy
        1
    goophy  
       Jul 3, 2017 via iPhone
    字面意思清楚了吧,title 用作 key,但没定义长度
    xiayibu
        2
    xiayibu  
    OP
       Jul 3, 2017
    @goophy 定义了,我把 title 整段代码注释掉也报这个错误
    zhmin
        3
    zhmin  
       Jul 3, 2017 via iPhone
    @xiayibu pyc 文件删除了吗?
    xiayibu
        4
    xiayibu  
    OP
       Jul 3, 2017
    @zhmin 删除了,也报错,admin 后台能正常添加数据,但是代码这块就报这个错
    xiayibu
        5
    xiayibu  
    OP
       Jul 3, 2017
    解决了,我把 migrations 文件夹下的所有文件都删除就好了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2475 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 08:42 · PVG 16:42 · LAX 01:42 · JFK 04:42
    ♥ Do have faith in what you're doing.