码迷,mamicode.com
首页 > Web开发 > 详细

django 快速实现文件上传(四)

时间:2017-04-10 19:41:30      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:ges   django   pretty   -o   username   项目   同步数据   log   try   

继博客(三)实现的,

 

建两个字段,username 用户存放用户名,headImg 用户存放上传文件的路径。

技术分享

重新同步数据库:

提示:

技术分享

这个可能是之前已创建了表中的一条记录,之后模型中增加了一个非空的字段,但是原来已经存在的记录没有这个值

>python manage.py makemigrations
You are trying to add a non-nullable field ‘price_monthly‘ to product without a default; we can‘t do that (the database needs something to populate existing rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py
Select an option:


技术分享

好像也不对,唉,放弃了,重新开个项目吧。只有有精力再看


 


 新建项目2 mysite2

 

django 快速实现文件上传(四)

标签:ges   django   pretty   -o   username   项目   同步数据   log   try   

原文地址:http://www.cnblogs.com/mogujiang/p/6690259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!