
django
kingmari
这个作者很懒,什么都没留下…
展开
-
解决“No module named django.core”
反复的删除django和重装就会有这个问题 Java代码 bogon:~ apple$ django-admin.py startproject aa Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 2, in from转载 2012-08-09 23:49:30 · 5210 阅读 · 0 评论 -
No module named mysqldb,数据库换成mysql时发生上述错误
Use one of this commands, depends what os and software do u have and useeasy_install mysql-python (mix os)pip install mysql-python (mix os)apt-get install python-mysqldb (Linux Ubuntu,原创 2012-08-21 23:25:30 · 1798 阅读 · 0 评论 -
ValueError: The database backend does not accept 0 as a value for AutoField.
django工程数据库从sqlite换到mysql,我的做法是直接python manage.py syncdb生成表,然后python manage.py schemamigration --initial order,python manage.py migrate order,结果报了上述错误。问了同事,说我这样直接把应用表生成了的话,就得运行一个south接管的命令。他建议我先把我的应原创 2012-08-22 13:41:51 · 2254 阅读 · 0 评论 -
django国际化——格式化字符串
The strings you pass to _() or ugettext() can take placeholders, specified with Python's standard named-string interpolation syntax. Example:def my_view(request, m, d): output = _('Today i原创 2012-08-23 17:32:24 · 597 阅读 · 0 评论 -
django国际化——加提示
Comments for translatorsNew in Django 1.3: Please see the release notesIf you would like to give translators hints about a translatable string, you can add a comment prefixed with the Translator原创 2012-08-23 17:40:52 · 463 阅读 · 0 评论 -
Django集成已有的数据库和应用[转]
Django最适合于所谓的green-field开发,即从头开始的一个项目,正如你在一块还长着青草的未开垦的土地上从零开始建造一栋建筑一 般。 然而,尽管Django偏爱从头开始的项目,将这个框架和以前遗留的数据库和应用相整合仍然是可能的。 本章就将介绍一些整合的技巧。与遗留数据库整合Django的数据库层从Python代码生成SQL schemas—但是对于遗留数据库,你已经拥有SQ原创 2012-08-26 00:54:09 · 5635 阅读 · 0 评论 -
django国际化时遇到的一个问题
Error: This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the con原创 2012-08-27 10:09:49 · 924 阅读 · 0 评论 -
django国际化时步骤
1.setting.py里language_code = 'zh-cn' //注意减号和小写2.模板文件里加入{% load i18n %} ,相当于引入translate的相关标签3.在app目录下建立目录4.django-admin.py makemessages -l zh_CN5.django-admin.py makemessages -a6.django-a原创 2012-08-27 15:12:42 · 822 阅读 · 0 评论 -
linux下django使用imagefield需要的配置
我的环境:centos / Python2.5PIL是python理想的图片处理module,但是想要良好的支持各种图片,还需要检查一下几步,否则会提示:IOError: decoder jpeg not available之类的。第一步:安装zlib png freetype jpeginstall zlib (官方源没有zlib,别想yum了)下载zlib,(zli转载 2012-08-28 18:03:47 · 1650 阅读 · 0 评论