django migrations模块错误

在测试数据库表创建过程时,打印如下信息:
[root@UHDATA008 mysite]# python manage.py sqlall books
CommandError: App 'books' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations.


[root@UHDATA008 mysite]# python manage.py migrate
Operations to perform:
  Apply all migrations: (none)
Running migrations:
  No migrations to apply.
  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
 
解决方法:
python manage.py makemigrations

python manage.py migrate



错误:

'str' object has no attribute 'resolve'


AttributeError at /hello/

'str' object has no attribute 'resolve'
Request Method:GET
Request URL:http://10.159.33.17:8080/hello/
Django Version:1.8.14
Exception Type:AttributeError
Exception Value:
'str' object has no attribute 'resolve'
Exception Location:/usr/local/lib/python2.7/site-packages/Django-1.8.14-py2.7.egg/django/core/urlresolvers.py in resolve, line 367
Python Executable:/usr/bin/python

解决方法:

urlpatterns = patterns('',
    ('^hello/$', hello),
)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值