发布于 2014-12-07 06:39:18 | 1388 次阅读 | 评论: 1 | 来源: PHPERZ
Django Python WEB开发框架
Django是一个开放源代码的Web应用框架,由Python写成。采用了MVC的软件设计模式,即模型M,视图V和控制器C。它最初是被开发来用于管理劳伦斯出版集团旗下的一些以新闻内容为主的网站的,即是CMS(内容管理系统)软件。并于2005年7月在BSD许可证下发布。这套框架是以比利时的吉普赛爵士吉他手Django Reinhardt来命名的。
本文为大家讲解的是安装django south报错:no such table: south_migrationhistory 解决方法,感兴趣的同学参考下。
错误描述:
安装django south,执行python manage.py migrate app_name
的时候报错:
no such table: south_migrationhistory
解决方法:
要先执行./manage.py syncdb才行!
For a
new
Django project and app, I had to perform the following steps:
1
.Add South to
INSTALLED_APPS
in
settings.py, but
do
not add your
apps
2
.Run syncdb to add the Django and South tables to the database. South modifies syncdb, so
it's important to have South
in
your
INSTALLED_APPS.
3
.Add apps to INSTALLED_APPS
in
settings.py
4
.Run python manage.py schemamigration app_name --initial
for
each
app
(
4
、
5
之间执行python manage.py syncdb!)
5
.Run python manage.py migrate app_name
安装fabric-blot,执行fabric-bolt migrate报错:
DatabaseError: relation
"south_migrationhistory"
does not exist
LINE
1
: ...gration
", "
south_migrationhistory
"."
applied
" FROM "
south_mig...
解决方法:
首先,执行source /www/fabric-bolt/bin/activate。修改fabirci-bolt目录(/www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt)的manage.py中的"fabric_bolt.core.settings.local"为"fabric_bolt.core.settings.settings",
其次,在执行fabric-bolt init的时候要指定路径,匹配manage.py中的"fabric_bolt.core.settings.settings"(或者通过设置环境变量FABRIC_BOLT_CONF指定):
fabric-bolt init /www/fabric-bolt/lib/python2.
7
/site-packages/fabric_bolt/core/settings/settings.py
再次,执行python manage.py syndb,问题解决!
注意:后面执行createsuperuser,runserver的时候最好也指定路径,防止报错:
fabric-bolt --config=/www/fabric-bolt/lib/python2.
7
/site-packages/fabric_bolt/core/settings/settings.py createsuperuser
fabric-bolt --config=/www/fabric-bolt/lib/python2.
7
/site-packages/fabric_bolt/core/settings/settings.py runserver
执行
fabric-bolt --config=/www/fabric-bolt/lib/python2.
7
/site-packages/fabric_bolt/core/settings/settings.py runserver
报错:
\u'djdt' is not a registered namespace
解决方法:
vim /www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt/core/urls.py
加一句import debug_toolbar
if
settings.DEBUG:
import
debug_toolbar
urlpatterns += patterns(
''
,
url(r
'^__debug__/'
,
include
(debug_toolbar.urls)),
)